From 02018da187d9c9c4d38d3d07ed4cc48055b3ef17 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 1 Nov 2017 13:33:57 -0400 Subject: [PATCH] Add aliases to the client library Replicate for the sake of retrieving values by aliased names. --- confluent_client/confluent/client.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/confluent_client/confluent/client.py b/confluent_client/confluent/client.py index 92fe4c86..bc2b5897 100644 --- a/confluent_client/confluent/client.py +++ b/confluent_client/confluent/client.py @@ -26,6 +26,11 @@ import confluent.tlvdata as tlvdata SO_PASSCRED = 16 +_attraliases = { + 'bmc': 'hardwaremanagement.manager', + 'bmcuser': 'secret.hardwaremanagementuser', + 'bmcpass': 'secret.hardwaremanagementpassword', +} def cprint(txt): print(txt) @@ -282,6 +287,8 @@ def attrrequested(attr, attrlist, seenattributes): truename = candidate if candidate.startswith('hm'): candidate = candidate.replace('hm', 'hardwaremanagement', 1) + if candidate in _attraliases: + candidate = _attraliases[candidate] if candidate == attr: seenattributes.add(truename) return True