Configurable Host HTTP/HTTPS Port Binding
Add http_port to tsconfig and update patch URL Story: 2004642 Task: 29263 Depends-On: https://review.openstack.org/#/c/634237/ Change-Id: Ic34a66ae90d345b16922fa6031631dfb04f67afa Signed-off-by: Tao Liu <tao.liu@windriver.com>
This commit is contained in:
parent
7ac96439f4
commit
164380898a
|
@ -31,7 +31,7 @@ function check_for_rr_patch {
|
||||||
|
|
||||||
function check_install_uuid {
|
function check_install_uuid {
|
||||||
# Check whether our installed load matches the active controller
|
# 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 [ $? -ne 0 ]; then
|
||||||
if [ "$HOSTNAME" = "controller-1" ]; then
|
if [ "$HOSTNAME" = "controller-1" ]; then
|
||||||
# If we're on controller-1, controller-0 may not have the install_uuid
|
# If we're on controller-1, controller-0 may not have the install_uuid
|
||||||
|
|
|
@ -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
|
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.messages as messages
|
||||||
import cgcs_patch.constants as constants
|
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"
|
pidfile_path = "/var/run/patch_agent.pid"
|
||||||
node_is_patched_file = "/var/run/node_is_patched"
|
node_is_patched_file = "/var/run/node_is_patched"
|
||||||
|
@ -77,7 +77,7 @@ def clearflag(fname):
|
||||||
|
|
||||||
|
|
||||||
def check_install_uuid():
|
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:
|
try:
|
||||||
req = requests.get(controller_install_uuid_url)
|
req = requests.get(controller_install_uuid_url)
|
||||||
if req.status_code != 200:
|
if req.status_code != 200:
|
||||||
|
@ -353,11 +353,11 @@ class PatchAgent(PatchService):
|
||||||
{'channel': 'base',
|
{'channel': 'base',
|
||||||
'type': 'rpm-md',
|
'type': 'rpm-md',
|
||||||
'name': 'Base',
|
'name': 'Base',
|
||||||
'baseurl': "http://controller/feed/rel-%s" % SW_VERSION},
|
'baseurl': "http://controller:%s/feed/rel-%s" % (http_port, SW_VERSION)},
|
||||||
{'channel': 'updates',
|
{'channel': 'updates',
|
||||||
'type': 'rpm-md',
|
'type': 'rpm-md',
|
||||||
'name': 'Patches',
|
'name': 'Patches',
|
||||||
'baseurl': "http://controller/updates/rel-%s" % SW_VERSION}]
|
'baseurl': "http://controller:%s/updates/rel-%s" % (http_port, SW_VERSION)}]
|
||||||
|
|
||||||
updated = False
|
updated = False
|
||||||
|
|
||||||
|
@ -580,7 +580,7 @@ class PatchAgent(PatchService):
|
||||||
self.missing_pkgs = []
|
self.missing_pkgs = []
|
||||||
installed_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:
|
try:
|
||||||
req = requests.get(groups_url)
|
req = requests.get(groups_url)
|
||||||
if req.status_code != 200:
|
if req.status_code != 200:
|
||||||
|
|
|
@ -32,6 +32,7 @@ system_mode = None
|
||||||
security_profile = None
|
security_profile = None
|
||||||
distributed_cloud_role = None
|
distributed_cloud_role = None
|
||||||
security_feature = None
|
security_feature = None
|
||||||
|
http_port = "8080"
|
||||||
|
|
||||||
PLATFORM_CONF_PATH = '/etc/platform'
|
PLATFORM_CONF_PATH = '/etc/platform'
|
||||||
PLATFORM_CONF_FILE = os.path.join(PLATFORM_CONF_PATH, 'platform.conf')
|
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'):
|
if config.has_option('platform_conf', 'security_feature'):
|
||||||
security_feature = str(config.get('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:
|
except configparser.Error:
|
||||||
logging.exception("Failed to read platform.conf")
|
logging.exception("Failed to read platform.conf")
|
||||||
return False
|
return False
|
||||||
|
|
Loading…
Reference in New Issue