Skip to content
Permalink
Browse files

Remove unused code

Remove is_pingable and load_stackrc methods its
not being used anywhere.

Change-Id: Ie7019fcaaa2523f9b8aeafa4414b0d5d195d6a52
Signed-off-by: Charles Short <chucks@redhat.com>
  • Loading branch information...
zulcss committed Nov 12, 2019
1 parent b988da6 commit ac140154da7b29d83d848e4a904ddbc619268dfb
Showing with 0 additions and 31 deletions.
  1. +0 −31 browbeat/tools.py
@@ -27,15 +27,6 @@ def __init__(self, config):
self.logger = logging.getLogger('browbeat.tools')
self.config = config

# Returns true if ping successful, false otherwise
def is_pingable(self, ip):
cmd = "ping -c1 " + ip
result = self.run_cmd(cmd)
if result['rc'] == 0:
return True
else:
return False

# Run command, return stdout as result
def run_cmd(self, cmd):
self.logger.debug("Running command : %s" % cmd)
@@ -150,25 +141,3 @@ def post_process(self, cli):
if workload is "perfkit":
# Stub for PerfKit.
continue

def load_stackrc(self, filepath):
values = {}
with open(filepath) as stackrc:
for line in stackrc:
pair = line.split('=')
if 'export' in line:
continue
elif '#' in line:
continue
elif 'if' in line or 'fi' in line:
continue
elif line == '\n':
continue

if '$(' not in line:
values[pair[0].strip()] = pair[1].strip()
elif '$(' in line and 'for key' not in line:
values[pair[0].strip()] = \
self.run_cmd(
"echo " + pair[1].strip())['stdout'].strip()
return values

0 comments on commit ac14015

Please sign in to comment.
You can’t perform that action at this time.