|
|
|
@ -154,6 +154,9 @@ CMD_OPTIONS = [{'shortOption':"d",
|
|
|
|
|
{'longOption':"startup",
|
|
|
|
|
'help':_("configure current system")
|
|
|
|
|
},
|
|
|
|
|
{'longOption':"live",
|
|
|
|
|
'help':_("configure only mutable parameters in current system")
|
|
|
|
|
},
|
|
|
|
|
{'longOption':"install",
|
|
|
|
|
'help':_("install package")
|
|
|
|
|
},
|
|
|
|
@ -191,7 +194,10 @@ class install_cmd(share_cmd):
|
|
|
|
|
self.logicObj = cl_install()
|
|
|
|
|
# names incompatible options with --startup
|
|
|
|
|
self.optionsStartupIncompatible = ["type","d", "b", "mbr",
|
|
|
|
|
"w", "f","U", "s","install","uninstall","build","u"]
|
|
|
|
|
"w", "f","U", "s","install","uninstall","build","u","live"]
|
|
|
|
|
# names incompatible options with --live
|
|
|
|
|
self.optionsLiveIncompatible = ["type","d", "b", "mbr",
|
|
|
|
|
"w", "f","U", "s","install","uninstall","build","u","startup"]
|
|
|
|
|
self.optionsDhcpIncompatible = ["ip","gateway","dns"]
|
|
|
|
|
self.errorWithExample = \
|
|
|
|
|
_("option {optname}: {errormess}:"
|
|
|
|
@ -218,6 +224,14 @@ class install_cmd(share_cmd):
|
|
|
|
|
self.optobj.error(_("incompatible options")+":"+" %s"\
|
|
|
|
|
%self.getStringIncompatibleOptions(incompatible+["startup"]))
|
|
|
|
|
|
|
|
|
|
def checkIncompatibleLive(self):
|
|
|
|
|
"""Check incompatible options for option --live"""
|
|
|
|
|
incompatible = list(set(self._getNamesAllSetOptions()) &
|
|
|
|
|
set(self.optionsLiveIncompatible))
|
|
|
|
|
if incompatible:
|
|
|
|
|
self.optobj.error(_("incompatible options")+":"+" %s"\
|
|
|
|
|
%self.getStringIncompatibleOptions(incompatible+["live"]))
|
|
|
|
|
|
|
|
|
|
def checkIncompatibleDhcp(self):
|
|
|
|
|
"""Check incompatible options for option --dchp"""
|
|
|
|
|
incompatible = list(set(self._getNamesAllSetOptions()) &
|
|
|
|
@ -252,6 +266,8 @@ class install_cmd(share_cmd):
|
|
|
|
|
self.checkIncompatibleInstallUninstall()
|
|
|
|
|
if values.startup:
|
|
|
|
|
self.checkIncompatibleStartup()
|
|
|
|
|
if values.live:
|
|
|
|
|
self.checkIncompatibleLive()
|
|
|
|
|
if values.dhcp:
|
|
|
|
|
self.checkIncompatibleDhcp()
|
|
|
|
|
if not values.v:
|
|
|
|
@ -293,7 +309,9 @@ class install_cmd(share_cmd):
|
|
|
|
|
errormess=_("%s specifing error")%_("route"),
|
|
|
|
|
value=route,
|
|
|
|
|
example="default:192.168.1.1"))
|
|
|
|
|
if not (values.install or values.uninstall or values.startup):
|
|
|
|
|
# if system installation
|
|
|
|
|
if not (values.install or values.uninstall
|
|
|
|
|
or values.startup or values.live):
|
|
|
|
|
if values.v is False and \
|
|
|
|
|
not values.p and \
|
|
|
|
|
values.d is None and \
|
|
|
|
@ -413,10 +431,14 @@ class install_cmd(share_cmd):
|
|
|
|
|
return False
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
def setAction(self,startup):
|
|
|
|
|
def setAction(self,startup,live):
|
|
|
|
|
"""Set action by configuration or install system"""
|
|
|
|
|
self.logicObj.clVars.Set('cl_action',
|
|
|
|
|
"merge" if startup else "system",True)
|
|
|
|
|
if live:
|
|
|
|
|
self.logicObj.clVars.Set('cl_action',"live",True)
|
|
|
|
|
elif startup:
|
|
|
|
|
self.logicObj.clVars.Set('cl_action',"merge",True)
|
|
|
|
|
else:
|
|
|
|
|
self.logicObj.clVars.Set('cl_action',"system",True)
|
|
|
|
|
|
|
|
|
|
def checkAndSetInstallOptions(self,diskOptions, swapOptions,
|
|
|
|
|
usersOptions):
|
|
|
|
@ -568,15 +590,3 @@ class install_cmd(share_cmd):
|
|
|
|
|
return True
|
|
|
|
|
else:
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
def parse_args(self, args=None, values=None):
|
|
|
|
|
"""
|
|
|
|
|
Preparse for catch non option --live
|
|
|
|
|
"""
|
|
|
|
|
rargs = self.optobj._get_args(args)
|
|
|
|
|
if rargs:
|
|
|
|
|
for arg in rargs:
|
|
|
|
|
if arg == "--live":
|
|
|
|
|
self.optobj.error(_("option %s:") %"--live" +\
|
|
|
|
|
" " + _("option is depricated, use '--startup' option"))
|
|
|
|
|
return self.optobj.parse_args(args,values)
|
|
|
|
|