Remove code and settings no longer used

This commit is contained in:
Alan Rominger
2021-05-18 15:27:04 -04:00
parent 7801590bef
commit cb1df4a334
8 changed files with 12 additions and 61 deletions

View File

@@ -10,7 +10,6 @@ import subprocess
import sys
import time
import traceback
import shutil
# Django
from django.conf import settings
@@ -75,17 +74,6 @@ class AnsibleInventoryLoader(object):
else:
self.venv_path = settings.ANSIBLE_VENV_PATH
def get_path_to_ansible_inventory(self):
venv_exe = os.path.join(self.venv_path, 'bin', 'ansible-inventory')
if os.path.exists(venv_exe):
return venv_exe
elif os.path.exists(os.path.join(self.venv_path, 'bin', 'ansible')):
# if bin/ansible exists but bin/ansible-inventory doesn't, it's
# probably a really old version of ansible that doesn't support
# ansible-inventory
raise RuntimeError("{} does not exist (please upgrade to ansible >= 2.4)".format(venv_exe))
return shutil.which('ansible-inventory')
def get_base_args(self):
bargs = ['podman', 'run', '--user=root', '--quiet']
bargs.extend(['-v', '{0}:{0}:Z'.format(self.source)])