Skip to content

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
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
Charles Short committed Nov 12, 2019
1 parent b988da6 commit ac14015
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions browbeat/tools.py
Expand Up @@ -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)
Expand Down Expand Up @@ -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.