From d91c1a998d85006f9b8de792819bd15aef42a831 Mon Sep 17 00:00:00 2001 From: Karthik Kamurthy Date: Fri, 10 Jun 2022 14:48:48 -0400 Subject: [PATCH] AQUILONAQD-1228/MAKEFILE-FOR-RHEL7-BUILD * graphviz package is not compatible for RHEL7, even with the latest version. The scrips using these modules will not be executed on RHEL7 and will run RHEL6 based on the Makefile updates. * If a client config file is specified on command line, that should overide AQHOST env or default options. * If the incoming readonly command has AQHOST /AQPORT set, the aqhost not to be overriden. --- Makefile | 8 +++++--- bin/aq.py | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index a8afbca8f..fca2eb63a 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,7 @@ MPR := $(shell echo $(PWD) | awk -F/ '{print $$(NF-3), $$(NF-2), $$(NF-1)}') META = $(word 1,$(MPR)) PROJ = $(word 2,$(MPR)) REL = $(word 3,$(MPR)) +NON_AQ6_HOST := $(findstring 6., $(shell egrep '\s6\.[0-9]+' /etc/redhat-release)) ifneq (aquilon,$(META)) META = aquilon @@ -121,8 +122,10 @@ install: remove_stale $(INSTALLFILES) install-doc ln -sf aqd "$(COMMON)/sbin/aqd_readonly" $(COMMON)/sbin/aqd --help >/dev/null ./tools/gen_completion.py --outputdir="$(COMMON)/etc" --templatedir="./etc/templates" --all - ./tools/graph_schema.py --outputdir="$(COMMON)/doc" - ./tools/build_schema_htdocs.py --outputdir="$(COMMON)/doc/schema" + if ! [ -z "${strip $(NON_AQ6_HOST)}" ]; then \ + ./tools/graph_schema.py --outputdir="$(COMMON)/doc"; \ + ./tools/build_schema_htdocs.py --outputdir="$(COMMON)/doc/schema"; \ + fi .PHONY: install-doc install-doc: @@ -189,4 +192,3 @@ thaw: create: vms create release ${META} ${PROJ} ${REL} -- -nobuildvolume vms create install ${META} ${PROJ} ${REL} common - diff --git a/bin/aq.py b/bin/aq.py index 60aa28a21..25271686f 100755 --- a/bin/aq.py +++ b/bin/aq.py @@ -376,7 +376,7 @@ def get_default_opts(auth_option, conf_file=None, readonly=None, if globalOptions.get('aqconf'): globalOptions.update(get_default_opts(globalOptions.get('auth'), globalOptions.get('aqconf'), - readonly=is_readonly(command))) + readonly=is_readonly(command))[0]) # Default for /ms/dist if re.match(r"/ms(/.(global|local)/[^/]+)?/dist/", BINDIR): @@ -390,8 +390,8 @@ def get_default_opts(auth_option, conf_file=None, readonly=None, default_aqhost = socket.gethostname() default_aqservice = get_username() - if override_allowed: - host = defaultOpts.get('aqhost') or os.environ.get('AQHOST', None) + if override_allowed and not globalOptions.get('aqconf'): + host = os.environ.get('AQHOST', None) or defaultOpts.get('aqhost') else: host = globalOptions.get('aqhost') or os.environ.get('AQHOST', None) or \ defaultOpts.get('aqhost') or default_aqhost