X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=inventoryhandlers%2Fhwinventory%2Fhwinventory.py;h=7768426b8681a64fbeaced0d5a3e7f35c5a20e2a;hb=69a3689dc1dbec809f9af555f54e971e8b48bc1f;hp=76ea0a9f9ba95ca7af0fc6be147a4fc53834b567;hpb=a58547f77cc273737e083e440c6ec3b234839a14;p=ta%2Fcm-plugins.git diff --git a/inventoryhandlers/hwinventory/hwinventory.py b/inventoryhandlers/hwinventory/hwinventory.py old mode 100644 new mode 100755 index 76ea0a9..7768426 --- a/inventoryhandlers/hwinventory/hwinventory.py +++ b/inventoryhandlers/hwinventory/hwinventory.py @@ -61,7 +61,7 @@ class hwinventory(cmansibleinventoryconfig.CMAnsibleInventoryConfigPlugin): self._set_hw_types() self._add_hw_config() - + def _add_hw_config(self): try: text = Environment().from_string(JSON_HW_HOST_VAR).render( @@ -78,8 +78,9 @@ class hwinventory(cmansibleinventoryconfig.CMAnsibleInventoryConfigPlugin): hwmgmt_addr = self._hosts_config_handler.get_hwmgmt_ip(name) hwmgmt_user = self._hosts_config_handler.get_hwmgmt_user(name) hwmgmt_pass = self._hosts_config_handler.get_hwmgmt_password(name) - return hw.get_hw_data(hwmgmt_addr, hwmgmt_user, hwmgmt_pass) - + hwmgmt_priv_level = self._hosts_config_handler.get_hwmgmt_priv_level(name) + return hw.get_hw_data(hwmgmt_addr, hwmgmt_user, hwmgmt_pass, hwmgmt_priv_level) + def _set_hw_types(self): hosts = self._hosts_config_handler.get_hosts() for host in hosts: @@ -88,4 +89,4 @@ class hwinventory(cmansibleinventoryconfig.CMAnsibleInventoryConfigPlugin): host_object.vendor = hw_details.get("vendor", "Unknown") host_object.product_family = hw_details.get("product_family", "Unknown") host_object.mgmt_mac = hw_details.get('info', {}).get("MAC Address", "00:00:00:00:00:00") - self.host_objects.append(host_object) + self.host_objects.append(host_object)