summaryrefslogtreecommitdiff
path: root/azurelinuxagent/daemon/resourcedisk/freebsd.py
diff options
context:
space:
mode:
authorƁukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com>2017-01-16 10:10:41 +0100
committerusd-importer <ubuntu-server@lists.ubuntu.com>2017-01-17 17:53:13 +0000
commitdd73af563850762aad64e7ed2a9897377830af10 (patch)
tree33f34ccce29a5a11227741dbe6a8fce20deeeaba /azurelinuxagent/daemon/resourcedisk/freebsd.py
parenta05019d9343d0fde153d75a8e61fb6f99d1d3ff3 (diff)
parent558111e33720eb8f1eaacf571cf4fadae2430286 (diff)
downloadvyos-walinuxagent-dd73af563850762aad64e7ed2a9897377830af10.tar.gz
vyos-walinuxagent-dd73af563850762aad64e7ed2a9897377830af10.zip
Import patches-applied version 2.2.2-0ubuntu1 to applied/ubuntu/zesty-proposed
Imported using git-ubuntu import. Changelog parent: a05019d9343d0fde153d75a8e61fb6f99d1d3ff3 Unapplied parent: 558111e33720eb8f1eaacf571cf4fadae2430286 New changelog entries: * New upstream release (LP: #1651128) - d/patches/fix-auto-update.patch, d/patches/lp1623570-adjust-walinuxagent-service-after-and-wants.patch: - Dropped as changes have been applied upstream - Refreshed debian/patches/disable_import_test.patch
Diffstat (limited to 'azurelinuxagent/daemon/resourcedisk/freebsd.py')
-rw-r--r--azurelinuxagent/daemon/resourcedisk/freebsd.py27
1 files changed, 16 insertions, 11 deletions
diff --git a/azurelinuxagent/daemon/resourcedisk/freebsd.py b/azurelinuxagent/daemon/resourcedisk/freebsd.py
index 36a3ac9..4ca0058 100644
--- a/azurelinuxagent/daemon/resourcedisk/freebsd.py
+++ b/azurelinuxagent/daemon/resourcedisk/freebsd.py
@@ -57,19 +57,24 @@ class FreeBSDResourceDiskHandler(ResourceDiskHandler):
raise ResourceDiskError("Unable to detect resource disk device:{0}".format(output))
disks = self.parse_gpart_list(output)
- err, output = shellutil.run_get_output('camcontrol periphlist 2:1:0')
- if err:
- raise ResourceDiskError("Unable to detect resource disk device:{0}".format(output))
+ device = self.osutil.device_for_ide_port(1)
+ if device is None:
+ # fallback logic to find device
+ err, output = shellutil.run_get_output('camcontrol periphlist 2:1:0')
+ if err:
+ # try again on "3:1:0"
+ err, output = shellutil.run_get_output('camcontrol periphlist 3:1:0')
+ if err:
+ raise ResourceDiskError("Unable to detect resource disk device:{0}".format(output))
# 'da1: generation: 4 index: 1 status: MORE\npass2: generation: 4 index: 2 status: LAST\n'
- device = None
- for line in output.split('\n'):
- index = line.find(':')
- if index > 0:
- geom_name = line[:index]
- if geom_name in disks:
- device = geom_name
- break
+ for line in output.split('\n'):
+ index = line.find(':')
+ if index > 0:
+ geom_name = line[:index]
+ if geom_name in disks:
+ device = geom_name
+ break
if not device:
raise ResourceDiskError("Unable to detect resource disk device.")