mirror of
https://github.com/ansible/awx.git
synced 2026-03-24 12:25:01 -02:30
Merge pull request #8516 from wenottingham/no-version-file
Don't write a tower_version file in awx Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
@@ -25,10 +25,12 @@ if MODE == 'production':
|
|||||||
try:
|
try:
|
||||||
fd = open("/var/lib/awx/.tower_version", "r")
|
fd = open("/var/lib/awx/.tower_version", "r")
|
||||||
if fd.read().strip() != tower_version:
|
if fd.read().strip() != tower_version:
|
||||||
raise Exception()
|
raise ValueError()
|
||||||
except Exception:
|
except FileNotFoundError:
|
||||||
|
pass
|
||||||
|
except ValueError as e:
|
||||||
logger.error("Missing or incorrect metadata for Tower version. Ensure Tower was installed using the setup playbook.")
|
logger.error("Missing or incorrect metadata for Tower version. Ensure Tower was installed using the setup playbook.")
|
||||||
raise Exception("Missing or incorrect metadata for Tower version. Ensure Tower was installed using the setup playbook.")
|
raise Exception("Missing or incorrect metadata for Tower version. Ensure Tower was installed using the setup playbook.") from e
|
||||||
|
|
||||||
|
|
||||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "awx.settings")
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "awx.settings")
|
||||||
|
|||||||
@@ -29,10 +29,12 @@ if MODE == 'production':
|
|||||||
try:
|
try:
|
||||||
fd = open("/var/lib/awx/.tower_version", "r")
|
fd = open("/var/lib/awx/.tower_version", "r")
|
||||||
if fd.read().strip() != tower_version:
|
if fd.read().strip() != tower_version:
|
||||||
raise Exception()
|
raise ValueError()
|
||||||
except Exception:
|
except FileNotFoundError:
|
||||||
|
pass
|
||||||
|
except ValueError as e:
|
||||||
logger.error("Missing or incorrect metadata for Tower version. Ensure Tower was installed using the setup playbook.")
|
logger.error("Missing or incorrect metadata for Tower version. Ensure Tower was installed using the setup playbook.")
|
||||||
raise Exception("Missing or incorrect metadata for Tower version. Ensure Tower was installed using the setup playbook.")
|
raise Exception("Missing or incorrect metadata for Tower version. Ensure Tower was installed using the setup playbook.") from e
|
||||||
|
|
||||||
|
|
||||||
# Return the default Django WSGI application.
|
# Return the default Django WSGI application.
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ RUN cd /tmp && make requirements_awx_dev requirements_ansible_dev
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% if not build_dev|bool %}
|
{% if not build_dev|bool %}
|
||||||
COPY {{ awx_sdist_file }} /tmp/{{ awx_sdist_file }}
|
COPY {{ awx_sdist_file }} /tmp/{{ awx_sdist_file }}
|
||||||
RUN mkdir -p -m 755 /var/lib/awx && echo "{{ awx_version }}" > /var/lib/awx/.tower_version && \
|
RUN mkdir -p -m 755 /var/lib/awx && \
|
||||||
OFFICIAL=yes /var/lib/awx/venv/awx/bin/pip install /tmp/{{ awx_sdist_file }}
|
OFFICIAL=yes /var/lib/awx/venv/awx/bin/pip install /tmp/{{ awx_sdist_file }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user