summaryrefslogtreecommitdiff
path: root/azurelinuxagent/common/osutil/freebsd.py
diff options
context:
space:
mode:
authorƁukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com>2017-07-03 13:44:00 +0200
committerusd-importer <ubuntu-server@lists.ubuntu.com>2017-07-03 12:23:41 +0000
commit70c0ea1ac879b2e1cba0a8edb1f3fbe82652413b (patch)
treef168bb289117feb1c0d5b2c73604b44e85b064e2 /azurelinuxagent/common/osutil/freebsd.py
parent68754fe67f1b3da2e6ca45885641941b3229698a (diff)
parent63aafec1b1a480947da7d5579c3ffc66b8fe5bdb (diff)
downloadvyos-walinuxagent-70c0ea1ac879b2e1cba0a8edb1f3fbe82652413b.tar.gz
vyos-walinuxagent-70c0ea1ac879b2e1cba0a8edb1f3fbe82652413b.zip
Import patches-applied version 2.2.14-0ubuntu1 to applied/ubuntu/artful-proposed
Imported using git-ubuntu import. Changelog parent: 68754fe67f1b3da2e6ca45885641941b3229698a Unapplied parent: 63aafec1b1a480947da7d5579c3ffc66b8fe5bdb New changelog entries: * New upstream release (LP: #1701350). * debian/copyright: - Refreshed copyright content.
Diffstat (limited to 'azurelinuxagent/common/osutil/freebsd.py')
-rw-r--r--azurelinuxagent/common/osutil/freebsd.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/azurelinuxagent/common/osutil/freebsd.py b/azurelinuxagent/common/osutil/freebsd.py
index 0f465a9..39d1760 100644
--- a/azurelinuxagent/common/osutil/freebsd.py
+++ b/azurelinuxagent/common/osutil/freebsd.py
@@ -229,17 +229,21 @@ class FreeBSDOSUtil(DefaultOSUtil):
err, output = shellutil.run_get_output(cmd_search_blkvsc)
if err == 0:
output = output.rstrip()
- cmd_search_dev="camcontrol devlist | grep {0} | awk -F \( '{{print $2}}'|awk -F , '{{print $1}}'".format(output)
+ cmd_search_dev="camcontrol devlist | grep {0} | awk -F \( '{{print $2}}'|sed -e 's/.*(//'| sed -e 's/).*//'".format(output)
err, output = shellutil.run_get_output(cmd_search_dev)
if err == 0:
- return output.rstrip()
+ for possible in output.rstrip().split(','):
+ if not possible.startswith('pass'):
+ return possible
cmd_search_storvsc = "camcontrol devlist -b | grep storvsc{0} | awk '{{print $1}}'".format(output)
err, output = shellutil.run_get_output(cmd_search_storvsc)
if err == 0:
output = output.rstrip()
- cmd_search_dev="camcontrol devlist | grep {0} | awk -F \( '{{print $2}}'|awk -F , '{{print $1}}'".format(output)
+ cmd_search_dev="camcontrol devlist | grep {0} | awk -F \( '{{print $2}}'|sed -e 's/.*(//'| sed -e 's/).*//'".format(output)
err, output = shellutil.run_get_output(cmd_search_dev)
if err == 0:
- return output.rstrip()
+ for possible in output.rstrip().split(','):
+ if not possible.startswith('pass'):
+ return possible
return None