On Fri, 2013-10-11 at 16:17 -0700, Andy Grover wrote: > On 10/11/2013 04:10 PM, Tregaron Bayly wrote: > > On Fri, 2013-10-11 at 15:41 -0700, Nicholas A. Bellinger wrote: > > >>> 3) reading/modifying/writing /etc/target/saveconfig.json then reloading > >>> config > >> > >> Ugh.. > > > > Seconded, but we considered it. > > Oh no? I thought this would be more popular, assuming most languages had > good tools for manipulating json. What was the sticking point? Just too > kludgey? Did it not work? It's kind of the worst of all worlds. It's overkill to clear your configuration and replace it with a savefile configuration if you only want to add or remove a lun. You also have no guarantee that someone hasn't messed with the savefile and you'll lose some of your running config when you apply it. You could try to limit this by having targetcli write a savefile first but that's time consuming and you can't check a return code to make sure it worked before proceeding. In fact that's the heart of the conundrum - the only guarantee that you have is that you've modified the json, but the entire solution requires relying on targetcli which we've already established can't be checked for success or failure. After you modify the file you have to clear your entire configuration and try to apply the savefile...with targetcli. You can't know whether it worked or not and if there's something wrong in the parsing of the file you don't get any configuration at all. In essence you have as much chance of having no running config or a broken config as a successful modification of whatever's running. That's a horrible risk to take. -- To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html