Created
April 7, 2014 15:29
-
-
Save jctanner/10022471 to your computer and use it in GitHub Desktop.
Ansible Install Troubleshooting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
import os | |
import hashlib | |
import ansible | |
from ansible import utils | |
sitedirs = [] | |
try: | |
import site | |
sitedirs += site.getsitepackages() | |
except: | |
pass | |
try: | |
from distutils.sysconfig import get_python_lib | |
sitedirs.append(get_python_lib()) | |
except: | |
pass | |
sitedirs = sorted(set(sitedirs)) | |
installdirs = [] | |
for path in sitedirs: | |
if os.path.isdir(path): | |
testpath = os.path.join(path, 'ansible') | |
if os.path.isdir(testpath): | |
installdirs.append(testpath) | |
thispath = ansible.__file__ | |
thispath = os.path.dirname(thispath) | |
print "# INSTALLED LIB PATH" | |
print thispath | |
print "# OTHER INSTALLED LIB PATHS" | |
for path in installdirs: | |
print path | |
module_list = [] | |
paths = utils.plugins.module_finder._get_paths() | |
for path in paths: | |
if os.path.isdir(path): | |
for module in os.listdir(path): | |
fullpath = os.path.join(path, module) | |
if os.path.isfile(fullpath): | |
module_list.append(fullpath) | |
print "# MODULES" | |
for module in sorted(module_list): | |
this_hash = hashlib.sha256(open(module, 'rb').read()).hexdigest() | |
print module,"\t",this_hash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Find the sha history for a file ...