summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPete Fotheringham <pete.fotheringham@codethink.co.uk>2014-11-28 10:14:53 +0000
committerPete Fotheringham <pete.fotheringham@codethink.co.uk>2014-11-28 10:21:06 +0000
commitdc6731dfd55f5e608feef8bcf0f504fe6928eba6 (patch)
treef80a7e37af45721986ece32055e12f64a3c2772a
parentdab2637b73be72edd266be2e23795bc636912471 (diff)
downloadmorph-dc6731dfd55f5e608feef8bcf0f504fe6928eba6.tar.gz
Refere to .write.help file for documentation
-rwxr-xr-xmorphlib/exts/kvm.write6
-rwxr-xr-xmorphlib/exts/virtualbox-ssh.write31
2 files changed, 11 insertions, 26 deletions
diff --git a/morphlib/exts/kvm.write b/morphlib/exts/kvm.write
index 61c96676..30b43d6c 100755
--- a/morphlib/exts/kvm.write
+++ b/morphlib/exts/kvm.write
@@ -15,7 +15,11 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-'''A Morph deployment write extension for deploying to KVM+libvirt.'''
+'''A Morph deployment write extension for deploying to KVM+libvirt.
+
+See file kvm.write.help for documentation
+
+'''
import cliapp
diff --git a/morphlib/exts/virtualbox-ssh.write b/morphlib/exts/virtualbox-ssh.write
index 39ea8f86..1b4de89c 100755
--- a/morphlib/exts/virtualbox-ssh.write
+++ b/morphlib/exts/virtualbox-ssh.write
@@ -20,6 +20,8 @@
VirtualBox is assumed to be running on a remote machine, which is
accessed over ssh. The machine gets created, but not started.
+See file virtualbox-ssh.write.help for documentation
+
'''
@@ -36,30 +38,10 @@ import morphlib.writeexts
class VirtualBoxPlusSshWriteExtension(morphlib.writeexts.WriteExtension):
- '''Create a VirtualBox virtual machine during Morph's deployment.
-
- The location command line argument is the pathname of the disk image
- to be created. The user is expected to provide the location argument
- using the following syntax:
-
- vbox+ssh://HOST/GUEST/PATH
-
- where:
-
- * HOST is the host on which VirtualBox is running
- * GUEST is the name of the guest virtual machine on that host
- * PATH is the path to the disk image that should be created,
- on that host
-
- The extension will connect to HOST via ssh to run VirtualBox's
- command line management tools.
-
- '''
-
def process_args(self, args):
if len(args) != 2:
raise cliapp.AppException('Wrong number of command line args')
-
+
temp_root, location = args
ssh_host, vm_name, vdi_path = self.parse_location(location)
autostart = self.get_environment_boolean('AUTOSTART')
@@ -88,7 +70,7 @@ class VirtualBoxPlusSshWriteExtension(morphlib.writeexts.WriteExtension):
def parse_location(self, location):
'''Parse the location argument to get relevant data.'''
-
+
x = urlparse.urlparse(location)
if x.scheme != 'vbox+ssh':
raise cliapp.AppException(
@@ -169,11 +151,11 @@ class VirtualBoxPlusSshWriteExtension(morphlib.writeexts.WriteExtension):
attach_disks = self.parse_attach_disks()
for device_no, disk in enumerate(attach_disks, 1):
- cmd = ['storageattach', vm_name,
+ cmd = ['storageattach', vm_name,
'--storagectl', 'SATA Controller',
'--port', str(device_no),
'--device', '0',
- '--type', 'hdd',
+ '--type', 'hdd',
'--medium', disk]
commands.append(cmd)
@@ -242,4 +224,3 @@ class VirtualBoxPlusSshWriteExtension(morphlib.writeexts.WriteExtension):
return iface
VirtualBoxPlusSshWriteExtension().run()
-