summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYour Name <you@example.com>2014-10-10 10:56:52 +0000
committerYour Name <you@example.com>2014-10-10 10:56:52 +0000
commitd03f454e7e39ac897754acb264f64e39143cc6d8 (patch)
tree2e8a3ce1e54d65eb20f371356b753a9a03cb2024
parentb15babc4a166e476d5bcd3946e8db8e2d4583969 (diff)
downloadmorph-d03f454e7e39ac897754acb264f64e39143cc6d8.tar.gz
Add location detection to check if it's a drive
-rw-r--r--morphlib/writeexts.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/morphlib/writeexts.py b/morphlib/writeexts.py
index 0fd0ad7b..9a6b6a28 100644
--- a/morphlib/writeexts.py
+++ b/morphlib/writeexts.py
@@ -223,7 +223,7 @@ class WriteExtension(cliapp.Application):
def mkfs_btrfs(self, location):
'''Create a btrfs filesystem on the disk.'''
- self.status(msg='Creating btrfs filesystem')
+ self.status(msg='Creating btrfs filesystem in %s' % location)
cliapp.runcmd(['mkfs.btrfs', '-L', 'baserock', location])
def get_uuid(self, location):
@@ -572,3 +572,8 @@ class WriteExtension(cliapp.Application):
logging.error("Error checking SSH connectivity: %s", str(e))
raise cliapp.AppException(
'Unable to SSH to %s: %s' % (ssh_host, e))
+ def deploying_to_device(self, location):
+ dev_regex = re.compile("^/dev/((sd|vd|mmcblk|hd)[a-z0-9]+)$")
+ if dev_regex(location):
+ return true
+ return false