summaryrefslogtreecommitdiff
path: root/morphlib
diff options
context:
space:
mode:
Diffstat (limited to 'morphlib')
-rwxr-xr-xmorphlib/exts/virtualbox-ssh.write14
-rw-r--r--morphlib/plugins/build_plugin.py8
-rw-r--r--morphlib/plugins/deploy_plugin.py6
-rw-r--r--morphlib/sysbranchdir.py8
4 files changed, 17 insertions, 19 deletions
diff --git a/morphlib/exts/virtualbox-ssh.write b/morphlib/exts/virtualbox-ssh.write
index 1b4de89c..fa54c296 100755
--- a/morphlib/exts/virtualbox-ssh.write
+++ b/morphlib/exts/virtualbox-ssh.write
@@ -169,20 +169,6 @@ class VirtualBoxPlusSshWriteExtension(morphlib.writeexts.WriteExtension):
def get_host_interface(self, ssh_host):
host_ipaddr = os.environ.get('HOST_IPADDR')
netmask = os.environ.get('NETMASK')
- network_config = os.environ.get("NETWORK_CONFIG")
-
- if network_config is None:
- raise cliapp.AppException('NETWORK_CONFIG was not given')
-
- if "eth0:" not in network_config:
- raise cliapp.AppException(
- 'NETWORK_CONFIG does not contain '
- 'the eth0 configuration')
-
- if "eth1:" not in network_config:
- raise cliapp.AppException(
- 'NETWORK_CONFIG does not contain '
- 'the eth1 configuration')
if host_ipaddr is None:
raise cliapp.AppException('HOST_IPADDR was not given')
diff --git a/morphlib/plugins/build_plugin.py b/morphlib/plugins/build_plugin.py
index c5adffb7..e9290b8d 100644
--- a/morphlib/plugins/build_plugin.py
+++ b/morphlib/plugins/build_plugin.py
@@ -17,6 +17,7 @@
import cliapp
import contextlib
import uuid
+import logging
import morphlib
@@ -160,11 +161,14 @@ class BuildPlugin(cliapp.Plugin):
self.app.settings['cachedir'],
self.app.settings['cachedir-min-space'])
- system_filename = morphlib.util.sanitise_morphology_path(args[0])
-
ws = morphlib.workspace.open('.')
sb = morphlib.sysbranchdir.open_from_within('.')
+ system_filename = morphlib.util.sanitise_morphology_path(args[0])
+ system_filename = sb.relative_to_root_repo(system_filename)
+
+ logging.debug('System branch is %s' % sb.root_directory)
+
if self.use_distbuild:
addr = self.app.settings['controller-initiator-address']
port = self.app.settings['controller-initiator-port']
diff --git a/morphlib/plugins/deploy_plugin.py b/morphlib/plugins/deploy_plugin.py
index 87fd259f..6d506a21 100644
--- a/morphlib/plugins/deploy_plugin.py
+++ b/morphlib/plugins/deploy_plugin.py
@@ -335,11 +335,12 @@ class DeployPlugin(cliapp.Plugin):
self.app.settings['tempdir-min-space'],
'/', 0)
- cluster_filename = morphlib.util.sanitise_morphology_path(args[0])
-
ws = morphlib.workspace.open('.')
sb = morphlib.sysbranchdir.open_from_within('.')
+ cluster_filename = morphlib.util.sanitise_morphology_path(args[0])
+ cluster_filename = sb.relative_to_root_repo(cluster_filename)
+
build_uuid = uuid.uuid4().hex
build_command = morphlib.buildcommand.BuildCommand(self.app)
@@ -351,6 +352,7 @@ class DeployPlugin(cliapp.Plugin):
build_ref_prefix = self.app.settings['build-ref-prefix']
root_repo_dir = morphlib.gitdir.GitDirectory(
sb.get_git_directory_name(sb.root_repository_url))
+
cluster_text = root_repo_dir.read_file(cluster_filename)
cluster_morphology = loader.load_from_string(cluster_text,
filename=cluster_filename)
diff --git a/morphlib/sysbranchdir.py b/morphlib/sysbranchdir.py
index 4dbc5f6c..80e56b33 100644
--- a/morphlib/sysbranchdir.py
+++ b/morphlib/sysbranchdir.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2013-2014 Codethink Limited
+# Copyright (C) 2013-2015 Codethink Limited
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -107,6 +107,11 @@ class SystemBranchDirectory(object):
return os.path.join(self.root_directory, relative)
+ def relative_to_root_repo(self, path): # pragma: no cover
+ gitdirpath = self.get_git_directory_name(self.root_repository_url)
+
+ return os.path.relpath(os.path.abspath(path), gitdirpath)
+
def get_git_directory_name(self, repo_url):
'''Return directory pathname for a given git repository.
@@ -123,6 +128,7 @@ class SystemBranchDirectory(object):
'''
found_repo = self._find_git_directory(repo_url)
+
if not found_repo:
return self._fabricate_git_directory_name(repo_url)
return found_repo