diff options
author | nicolargo <nicolas@nicolargo.com> | 2017-03-10 20:17:59 +0100 |
---|---|---|
committer | nicolargo <nicolas@nicolargo.com> | 2017-03-10 20:17:59 +0100 |
commit | 61d173c803f167892c2b9e0481592908785d8d2e (patch) | |
tree | 73ec19973eead8a061c366be65327dab0a45698c | |
parent | ce51f3e8d1a7c783630e11bedaae230f451ee16c (diff) |
Clod plugin error Name 'requests' is not defined #1047
-rw-r--r-- | glances/plugins/glances_cloud.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/glances/plugins/glances_cloud.py b/glances/plugins/glances_cloud.py index 591ef81a..5a59764f 100644 --- a/glances/plugins/glances_cloud.py +++ b/glances/plugins/glances_cloud.py @@ -149,6 +149,11 @@ class ThreadAwsEc2Grabber(threading.Thread): """Function called to grab stats. Infinite loop, should be stopped by calling the stop() method""" + if not cloud_tag: + logger.debug("cloud plugin - Requests lib is not installed") + self.stop() + return False + for k, v in iteritems(self.AWS_EC2_API_METADATA): r_url = '{}/{}'.format(self.AWS_EC2_API_URL, v) try: @@ -161,6 +166,8 @@ class ThreadAwsEc2Grabber(threading.Thread): if r.ok: self._stats[k] = r.content + return True + @property def stats(self): """Stats getter""" |