(self, host_source, cont_dest, new)
return True
Modify mount spec
Modify mount spec
Modify mount spec
def _mod_mount_spec(self, host_source, cont_dest, new):
        """Modify mount spec"""
        index = self._sel_mount_spec(host_source, cont_dest)
        if index is None:
            return False
        mount = self._container_specjson["mounts"][index]
        for new_item in new:
            if new_item == "options":
                if "options" not in mount:
                    mount["options"] = []
                for (new_index, dummy) in enumerate(new["options"]):
                    option_prefix = new["options"][new_index].split('=', 1)[0]
                    for (index, opt) in enumerate(mount["options"]):
                        if opt.startswith(option_prefix):
                            del mount["options"][index]
                    mount["options"] += new["options"]
            else:
                mount[new_item] = new[new_item]
        return True
def _mod_mount_spec ( self , host_source , cont_dest , new ) : index = self . _sel_mount_spec ( host_source , cont_dest ) if index is None : return False mount = self . _container_specjson [ "mounts" ] [ index ] for new_item in new : if new_item == "options" : if "options" not in mount : mount [ "options" ] = [ ] for ( new_index , dummy ) in enumerate ( new [ "options" ] ) : option_prefix = new [ "options" ] [ new_index ] . split ( '=' , 1 ) [ 0 ] for ( index , opt ) in enumerate ( mount [ "options" ] ) : if opt . startswith ( option_prefix ) : del mount [ "options" ] [ index ] mount [ "options" ] += new [ "options" ] else : mount [ new_item ] = new [ new_item ] return True