Hi,
I’m trying to allow ansible-inventory-grapher to install under pip on Windows. I’m using the standard python 2.7 for Windows.
As per https://github.com/ansible/ansible/issues/7049, the install fails during an import pwd.
I understand you don’t really want to support running Ansible itself on Windows, but it would be nice if it could at least be installed so that the library software could be used by other software.
The main problem is during any module import that relies on ansible.constants - and that’s only used for setting REMOTE_USER.
Something like
try:
import pwd
active_user = pwd.getpwuid(os.geteuid())[0]
except ImportError:
import getpass
active_user = getpass.getuser()
might suffice.
Anyway, happy to submit a PR after testing, if it’s at all likely to be accepted.
I can remove the dependency on ansible.constants in ansible-inventory-grapher (assuming a minor patch to remove the constant in the default to ansible.inventory.Inventory would be accepted) but that doesn’t help me during the installation process (as it’s ansible’s setup.py that is failing due to importing ansible.constants). And I really would prefer to use ansible’s inventory library rather than some copy that becomes out of date
Will