Skip to content

Commit 98ef90c

Browse files
nhe-NVselldinesh
authored andcommitted
Fix pdu issue (#20405)
The secret_group_vars is not always exist for all users, need to allow the secret_group_vars not defined as previously, the logic was broke by the PR: #20269 Signed-off-by: selldinesh <dinesh.sellappan@keysight.com>
1 parent eeba9a2 commit 98ef90c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/common/plugins/pdu_controller/snmp_pdu_controllers.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,9 @@ def _render_value(self, value, context):
215215
return value
216216

217217
def _get_pdu_snmp_creds(self, pdu, perm):
218-
context = {'secret_group_vars': pdu['secret_group_vars']}
218+
context = {}
219+
if 'secret_group_vars' in pdu:
220+
context = {'secret_group_vars': pdu['secret_group_vars']}
219221
if 'pdu_{}_snmp_version'.format(perm) in pdu:
220222
version = pdu['pdu_{}_snmp_version'.format(perm)]
221223
if version == 'v2c':

0 commit comments

Comments
 (0)