From d064ab0bffd429382ea4fafeb144784d403848bd Mon Sep 17 00:00:00 2001 From: Ɓukasz 'sil2100' Zemczak Date: Mon, 16 Jan 2017 10:10:41 +0100 Subject: Import patches-unapplied version 2.2.2-0ubuntu1 to ubuntu/zesty-proposed Imported using git-ubuntu import. Changelog parent: 63d399807de30a64456e672063e7c20babf7aadc 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 --- azurelinuxagent/daemon/resourcedisk/freebsd.py | 27 +++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'azurelinuxagent/daemon/resourcedisk/freebsd.py') 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.") -- cgit v1.2.3