Skip to content

Commit

Permalink
fix issues with code_checker and missed run_cmd changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards4b committed Jul 20, 2016
1 parent 1f9f0b3 commit 8659568
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions scripts/Tools/acme_check_env
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,23 @@ formatter_class=argparse.ArgumentDefaultsHelpFormatter
###############################################################################
def check_sh():
###############################################################################
stat = run_cmd('sh --version', ok_to_fail=True)[0]
stat = run_cmd('sh --version')[0]
if stat != 0:
LOG.append('* sh appears not to be available in your environment.')
LOG.append(' Please make sure it exists in your PATH.')

###############################################################################
def check_csh(): # Can't believe I'm actually checking for csh. -JNJ
###############################################################################
stat = run_cmd('csh --version', ok_to_fail=True)[0]
stat = run_cmd('csh --version')[0]
if stat != 0: # Also tolerates tcsh
LOG.append('* csh appears not to be available in your environment.')
LOG.append(' Please make sure it exists in your PATH.')

###############################################################################
def check_perl_module(module_name):
###############################################################################
stat = run_cmd('perl -e "require %s;"' % module_name, ok_to_fail=True)[0]
stat = run_cmd('perl -e "require %s;"' % module_name)[0]
if stat != 0:
LOG.append('* ACME requires the Perl module %s, but it is not available.'%module_name)
LOG.append(' Please make sure that it exists in your @INC.')
Expand All @@ -65,7 +65,7 @@ def check_perl():
acme_perl_major_version = 5
acme_perl_minor_version = 16

stat, output, _ = run_cmd("perl -e 'print $^V;'", ok_to_fail=True)
stat, output, _ = run_cmd("perl -e 'print $^V;'")
if stat != 0:
LOG.append('* Perl appears not to be available in your environment.')
LOG.append(' Please make sure it exists in your PATH.')
Expand All @@ -90,7 +90,7 @@ def check_git():
acme_git_major_version = 2
acme_git_minor_version = 0

stat, output, _ = run_cmd('git --version', ok_to_fail=True)
stat, output, _ = run_cmd('git --version')
if stat != 0:
LOG.append('* Git appears not to be available in your environment.')
LOG.append(' Please make sure it exists in your PATH.')
Expand All @@ -116,7 +116,7 @@ def check_svn():
acme_svn_minor_version = 4
acme_svn_patch_version = 2

stat, output, _ = run_cmd('svn --version --quiet', ok_to_fail=True)
stat, output, _ = run_cmd('svn --version --quiet')
if stat != 0:
LOG.append('* Subversion appears not to be available in your environment.')
LOG.append(' Please make sure it exists in your PATH.')
Expand Down
4 changes: 2 additions & 2 deletions scripts/Tools/case_diff
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,14 @@ def recursive_diff(dir1, dir2, show_binary=False, skip_list=[]):
# if (os.path.getsize(path1) != os.path.getsize(path2)):
# print path1 + " DIFFERS (contents)"

stat, out, err = run_cmd("file %s" % path1, ok_to_fail=True)
stat, out, err = run_cmd("file %s" % path1)
if (stat != 0):
logging.warn("Failed to probe file '%s', out: '%s', err: '%s'" % (path1, out, err))
continue

is_text_file = "text" in out
if (not (not show_binary and not is_text_file)):
stat, out, _ = run_cmd("diff -w %s %s" % (path1, path2), ok_to_fail=True)
stat, out, _ = run_cmd("diff -w %s %s" % (path1, path2))
if (stat != 0):
print "==============================================================================="
print path1 + " DIFFERS (contents)"
Expand Down
6 changes: 3 additions & 3 deletions scripts/Tools/code_checker
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ def run_pylint(on_file):
expect(pylint is not None,"pylint not found")

cmd = "%s --disable I,C,R,logging-not-lazy,wildcard-import,unused-wildcard-import,fixme,broad-except,bare-except,eval-used,exec-used,global-statement %s" % (pylint, on_file)
stat = run_cmd(cmd)[0]
stat, out, err = run_cmd(cmd)
if stat != 0:
sys.stdout.write("File %s has pylint problems, please fix\n Use command: %s\n" % (on_file, cmd))
sys.stdout.write("File %s has pylint problems, please fix\n Use command: %s\n%s\n %s\n %s\n" % (on_file, cmd, stat, out, err))
return False
else:
sys.stdout.write("File %s has no pylint problems\n" % on_file)
Expand All @@ -72,7 +72,7 @@ def check_code(dir_to_check, num_procs):
"""
# Pylint won't work right if the imports within the checked files fails
if "PYTHONPATH" in os.environ:
os.environ["PYTHONPATH"] += dir_to_check
os.environ["PYTHONPATH"] += ':' + dir_to_check
else:
os.environ["PYTHONPATH"] = dir_to_check

Expand Down

0 comments on commit 8659568

Please sign in to comment.