Skip to content

Commit 9c3750d

Browse files
authored
[advanced-reboot] Fix use of inventory file (#1723)
Commit 9814959 introduced mutiple inventory files that broke the logic to retreive secrets for specific inventory. Use inventory_file defined in hostvars instead. signed-off-by: Tamer Ahmed <[email protected]>
1 parent 9e9889d commit 9c3750d

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

tests/common/fixtures/advanced_reboot.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,9 @@ def __buildTestbedData(self):
121121
self.rebootData['vlan_ip_range'] = self.mgFacts['minigraph_vlan_interfaces'][0]['subnet']
122122
self.rebootData['dut_vlan_ip'] = self.mgFacts['minigraph_vlan_interfaces'][0]['addr']
123123

124-
invetory = self.duthost.host.options['inventory'].split('/')[-1]
125-
secrets = self.duthost.host.options['variable_manager']._hostvars[self.duthost.hostname]['secret_group_vars']
124+
hostVars = self.duthost.host.options['variable_manager']._hostvars[self.duthost.hostname]
125+
invetory = hostVars['inventory_file'].split('/')[-1]
126+
secrets = hostVars['secret_group_vars']
126127
self.rebootData['dut_username'] = secrets[invetory]['sonicadmin_user']
127128
self.rebootData['dut_password'] = secrets[invetory]['sonicadmin_password']
128129

0 commit comments

Comments
 (0)