Module: check_mk
Branch: master
Commit: 03999bf2b2024bdff30ba4b4430320b06406082b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=03999bf2b2024b…
Author: Moritz Kiemer <mo(a)mathias-kettner.de>
Date: Fri Dec 14 15:24:45 2018 +0100
agent azure: satisfy pylint
Change-Id: Idabb926de69bcf1872f4043fc3483ede6847d603
---
agents/special/agent_azure | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/agents/special/agent_azure b/agents/special/agent_azure
index 7d298f9..aca0ce6 100755
--- a/agents/special/agent_azure
+++ b/agents/special/agent_azure
@@ -233,7 +233,8 @@ class ResourceConfig(object):
self.name = name
self.fetchall = True
- def add_key(self, key, value):
+ @staticmethod
+ def add_key(key, _value):
raise ValueError("unknown key: %r" % key)
def __str__(self):
@@ -361,7 +362,7 @@ class IssueCollecter(object):
return len(self._list)
-class AzureMetric(object):
+class AzureMetric(object): # pylint: disable=too-few-public-methods
HEADER = ("name", "aggregation", "value",
"unit", "timestamp", "timegrain", "filters")
AGGREGATIONS = ("total", "average", "maximum",
"minimum", "last", "count")
@@ -431,20 +432,20 @@ class AzureComputeClient(object):
super(AzureComputeClient, self).__init__()
self._client = ComputeManagementClient(creds, subs)
- def process(self, vm, args):
+ def process(self, vmach, args):
use_keys = ('statuses',)
inst_view = self._client.virtual_machines.get(
- vm.info["group"], vm.info["name"],
expand='instanceView').instance_view.as_dict()
+ vmach.info["group"], vmach.info["name"],
expand='instanceView').instance_view.as_dict()
items = ((k, inst_view.get(k)) for k in use_keys)
- vm.info["specific_info"] = {k: v for k, v in items if v is not None}
+ vmach.info["specific_info"] = {k: v for k, v in items if v is not
None}
if args.piggyback_vms in ("agenthost", "all"):
- vm.piggytargets.append('')
+ vmach.piggytargets.append('')
if args.piggyback_vms in ("self", "all"):
- vm.piggytargets.append(vm.info["name"])
+ vmach.piggytargets.append(vmach.info["name"])
-class AzureClient(object):
+class AzureClient(object): # pylint: disable=too-many-instance-attributes
SPECIFIC_CLIENTS = {
'Microsoft.Compute/virtualMachines': AzureComputeClient,