Add XenPool.setup/destroy
This commit is contained in:
parent
97d04791b7
commit
62c81044c5
@ -71,12 +71,18 @@ class LinuxKernel(Pool):
|
||||
'driver': LinuxKernel.driver,
|
||||
}
|
||||
|
||||
def destroy(self):
|
||||
pass
|
||||
|
||||
def remove(self, volume):
|
||||
pass
|
||||
|
||||
def rename(self, volume, old_name, new_name):
|
||||
return volume
|
||||
|
||||
def setup(self):
|
||||
pass
|
||||
|
||||
def start(self, volume):
|
||||
path = volume.path
|
||||
if not os.path.exists(path):
|
||||
|
@ -45,12 +45,6 @@ class XenPool(Pool):
|
||||
assert dir_path, "No pool dir_path specified"
|
||||
self.dir_path = os.path.normpath(dir_path)
|
||||
|
||||
create_dir_if_not_exists(self.dir_path)
|
||||
appvms_path = os.path.join(self.dir_path, 'appvms')
|
||||
create_dir_if_not_exists(appvms_path)
|
||||
vm_templates_path = os.path.join(self.dir_path, 'vm-templates')
|
||||
create_dir_if_not_exists(vm_templates_path)
|
||||
|
||||
def clone(self, source, target):
|
||||
''' Clones the volume if the `source.pool` if the source is a
|
||||
:py:class:`XenVolume`.
|
||||
@ -148,6 +142,16 @@ class XenPool(Pool):
|
||||
os.umask(old_umask)
|
||||
return volume
|
||||
|
||||
def destroy(self):
|
||||
pass
|
||||
|
||||
def setup(self):
|
||||
create_dir_if_not_exists(self.dir_path)
|
||||
appvms_path = os.path.join(self.dir_path, 'appvms')
|
||||
create_dir_if_not_exists(appvms_path)
|
||||
vm_templates_path = os.path.join(self.dir_path, 'vm-templates')
|
||||
create_dir_if_not_exists(vm_templates_path)
|
||||
|
||||
def start(self, volume):
|
||||
if volume.volume_type == 'volatile':
|
||||
self._reset_volume(volume)
|
||||
|
Loading…
Reference in New Issue
Block a user