Merge "Configurable Host HTTP/HTTPS Port Binding"

This commit is contained in:
Zuul 2019-02-07 19:05:54 +00:00 committed by Gerrit Code Review
commit 574032c4fb
3 changed files with 12 additions and 7 deletions

View File

@ -31,7 +31,7 @@ function check_for_rr_patch {
function check_install_uuid {
# Check whether our installed load matches the active controller
CONTROLLER_UUID=`curl -sf http://controller/feed/rel-${SW_VERSION}/install_uuid`
CONTROLLER_UUID=`curl -sf http://controller:${http_port}/feed/rel-${SW_VERSION}/install_uuid`
if [ $? -ne 0 ]; then
if [ "$HOSTNAME" = "controller-1" ]; then
# If we're on controller-1, controller-0 may not have the install_uuid

View File

@ -1,5 +1,5 @@
"""
Copyright (c) 2014-2017 Wind River Systems, Inc.
Copyright (c) 2014-2019 Wind River Systems, Inc.
SPDX-License-Identifier: Apache-2.0
@ -28,7 +28,7 @@ import cgcs_patch.utils as utils
import cgcs_patch.messages as messages
import cgcs_patch.constants as constants
from tsconfig.tsconfig import (SW_VERSION, subfunctions, install_uuid)
from tsconfig.tsconfig import (SW_VERSION, subfunctions, install_uuid, http_port)
pidfile_path = "/var/run/patch_agent.pid"
node_is_patched_file = "/var/run/node_is_patched"
@ -77,7 +77,7 @@ def clearflag(fname):
def check_install_uuid():
controller_install_uuid_url = "http://controller/feed/rel-%s/install_uuid" % SW_VERSION
controller_install_uuid_url = "http://controller:%s/feed/rel-%s/install_uuid" % (http_port, SW_VERSION)
try:
req = requests.get(controller_install_uuid_url)
if req.status_code != 200:
@ -353,11 +353,11 @@ class PatchAgent(PatchService):
{'channel': 'base',
'type': 'rpm-md',
'name': 'Base',
'baseurl': "http://controller/feed/rel-%s" % SW_VERSION},
'baseurl': "http://controller:%s/feed/rel-%s" % (http_port, SW_VERSION)},
{'channel': 'updates',
'type': 'rpm-md',
'name': 'Patches',
'baseurl': "http://controller/updates/rel-%s" % SW_VERSION}]
'baseurl': "http://controller:%s/updates/rel-%s" % (http_port, SW_VERSION)}]
updated = False
@ -580,7 +580,7 @@ class PatchAgent(PatchService):
self.missing_pkgs = []
installed_pkgs = []
groups_url = "http://controller/updates/rel-%s/comps.xml" % SW_VERSION
groups_url = "http://controller:%s/updates/rel-%s/comps.xml" % (http_port, SW_VERSION)
try:
req = requests.get(groups_url)
if req.status_code != 200:

View File

@ -32,6 +32,7 @@ system_mode = None
security_profile = None
distributed_cloud_role = None
security_feature = None
http_port = "8080"
PLATFORM_CONF_PATH = '/etc/platform'
PLATFORM_CONF_FILE = os.path.join(PLATFORM_CONF_PATH, 'platform.conf')
@ -148,6 +149,10 @@ def _load():
if config.has_option('platform_conf', 'security_feature'):
security_feature = str(config.get('platform_conf', 'security_feature'))
global http_port
if config.has_option('platform_conf', 'http_port'):
http_port = str(config.get('platform_conf', 'http_port'))
except configparser.Error:
logging.exception("Failed to read platform.conf")
return False