Skip to content
This repository has been archived by the owner on Jan 16, 2019. It is now read-only.

Commit

Permalink
Merge pull request #29 from dbarrosop/develop
Browse files Browse the repository at this point in the history
Fixing merge conflicts
  • Loading branch information
dbarrosop authored Sep 10, 2016
2 parents 8f9726d + 70ab90f commit 9a32fc7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions napalm_ios/ios.py
Original file line number Diff line number Diff line change
Expand Up @@ -1043,19 +1043,19 @@ def get_environment(self):

output = self.device.send_command(cpu_cmd)
output = output.strip()
environment.setdefault('cpu', {})
environment['cpu'][0] = {}
environment['cpu'][0]['%usage'] = 0.0
for line in output.splitlines():
if 'CPU utilization' in line:
# CPU utilization for five seconds: 2%/0%; one minute: 2%; five minutes: 1%
cpu_regex = r'^.*one minute: (\d+)%; five.*$'
match = re.search(cpu_regex, line)
environment['cpu'][0]['%usage'] = float(match.group(1))
break
environment.setdefault('cpu', {})
environment['cpu'][0] = {}
environment['cpu'][0]['%usage'] = float(match.group(1))

output = self.device.send_command(mem_cmd)
output = output.strip()

for line in output.splitlines():
if 'Processor' in line:
_, _, _, proc_used_mem, proc_free_mem = line.split()[:5]
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
napalm-base
netaddr
netmiko>=0.4.3
netmiko>=0.5.0

0 comments on commit 9a32fc7

Please sign in to comment.