|
|
|
@ -36,14 +36,9 @@ CMD_OPTIONS = [{'shortOption':"d",
|
|
|
|
|
'optVal':"DISK[:[DIR:FILESYSTEM:OPTIONS]]",
|
|
|
|
|
'action':'append',
|
|
|
|
|
'help':_("the DISK for installation, which mounted to DIR") +
|
|
|
|
|
". "
|
|
|
|
|
+_("DIR with value 'none' will cancels the mount point transfer")
|
|
|
|
|
},
|
|
|
|
|
{'shortOption':"b",
|
|
|
|
|
'longOption':"bind",
|
|
|
|
|
'optVal':"SRC_DIR:DEST_DIR",
|
|
|
|
|
'action':'append',
|
|
|
|
|
'help':_("bind mount point for instalation")
|
|
|
|
|
". " +
|
|
|
|
|
_("DIR with value 'none' will cancels the mount point transfer")
|
|
|
|
|
+ ". " +_("For creating bind mount point need specify source directory as DISK")
|
|
|
|
|
},
|
|
|
|
|
{'shortOption':"w",
|
|
|
|
|
'longOption':"swap",
|
|
|
|
@ -266,15 +261,6 @@ class install_cmd(share_cmd):
|
|
|
|
|
self.optobj.error(_("option %s:") %"d" +\
|
|
|
|
|
" " + _("disk specifing error: '%s'")\
|
|
|
|
|
%", ".join(wrongValue))
|
|
|
|
|
# check syntax SRC_DIR:DEST_DIR
|
|
|
|
|
if values.b:
|
|
|
|
|
reTrueBind = re.compile("^[^:]+:[^:]+$")
|
|
|
|
|
wrongValue = filter(lambda x: not reTrueBind.match(x),values.b)
|
|
|
|
|
if wrongValue:
|
|
|
|
|
self.optobj.error(_("option %s:") %"b" +\
|
|
|
|
|
" " + _("mount bind specifing error: '%s'")\
|
|
|
|
|
%", ".join(wrongValue))
|
|
|
|
|
|
|
|
|
|
# check syntax SWAP_DISK
|
|
|
|
|
if values.w:
|
|
|
|
|
reTrueBind = re.compile("^[^:]+$")
|
|
|
|
@ -364,7 +350,7 @@ class install_cmd(share_cmd):
|
|
|
|
|
self.logicObj.clVars.Set('cl_action',
|
|
|
|
|
"merge" if live else "system",True)
|
|
|
|
|
|
|
|
|
|
def checkAndSetInstallOptions(self,diskOptions, swapOptions, bindOptions,
|
|
|
|
|
def checkAndSetInstallOptions(self,diskOptions, swapOptions,
|
|
|
|
|
usersOptions):
|
|
|
|
|
"""Check and set disk, swap and bind cmd options"""
|
|
|
|
|
if self.optobj.values.s:
|
|
|
|
@ -389,8 +375,7 @@ class install_cmd(share_cmd):
|
|
|
|
|
listDiskOptions = self._parseOptDisk(diskOptions)
|
|
|
|
|
if listDiskOptions is False:
|
|
|
|
|
return False
|
|
|
|
|
if bindOptions:
|
|
|
|
|
listBindOptions = self._parseOptBind(bindOptions)
|
|
|
|
|
listBindOptions = self._parseOptBind(diskOptions)
|
|
|
|
|
if listBindOptions is False:
|
|
|
|
|
return False
|
|
|
|
|
if swapOptions:
|
|
|
|
@ -423,6 +408,7 @@ class install_cmd(share_cmd):
|
|
|
|
|
|
|
|
|
|
def _parseOptBind(self, listOpt):
|
|
|
|
|
"""Parse value cmd option --bind"""
|
|
|
|
|
listOpt = filter(lambda x:not x.startswith('/dev/'),listOpt)
|
|
|
|
|
listNameOptions = ["srcMountPoint", "destMountPoint"]
|
|
|
|
|
lenOptions = len(listNameOptions)
|
|
|
|
|
itemOptions = map(lambda x: (x,''), listNameOptions)
|
|
|
|
@ -445,6 +431,7 @@ class install_cmd(share_cmd):
|
|
|
|
|
|
|
|
|
|
def _parseOptDisk(self, listOpt):
|
|
|
|
|
"""Parse value cmd option --disk"""
|
|
|
|
|
listOpt = filter(lambda x:x.startswith('/dev/'),listOpt)
|
|
|
|
|
listNameOptions = ["dev","mountPoint","fileSystem","options"]
|
|
|
|
|
lenOptions = len(listNameOptions)
|
|
|
|
|
itemOptions = map(lambda x: (x,''), listNameOptions)
|
|
|
|
|