Commit cc71018e authored by Jaroslava Fiedlerova's avatar Jaroslava Fiedlerova

Define server where to pull OC images

 - if the server is not specified in the xml file, eNBIPAddress is taken
parent a648b9ed
...@@ -82,6 +82,7 @@ class Cluster: ...@@ -82,6 +82,7 @@ class Cluster:
self.ranTargetBranch = "" self.ranTargetBranch = ""
self.cmd = None self.cmd = None
self.imageToPull = '' self.imageToPull = ''
self.testSvrId = None
def _recreate_entitlements(self): def _recreate_entitlements(self):
# recreating entitlements, don't care if deletion fails # recreating entitlements, don't care if deletion fails
...@@ -195,12 +196,13 @@ class Cluster: ...@@ -195,12 +196,13 @@ class Cluster:
self.cmd.run(f'oc delete -f {filename}') self.cmd.run(f'oc delete -f {filename}')
def PullClusterImage(self, HTML, RAN): def PullClusterImage(self, HTML, RAN):
if self.testSvrId == None: self.testSvrId = self.eNBIPAddress
if self.imageToPull == '': if self.imageToPull == '':
HELP.GenericHelp(CONST.Version) HELP.GenericHelp(CONST.Version)
HELP.EPCSrvHelp(self.imageToPull) sys.exit('Insufficient Parameter')
sys.exit('Insufficient eNB Parameters') logging.debug(f'Pull OC image {self.imageToPull} to server {self.testSvrId}')
self.testCase_id = HTML.testCase_id self.testCase_id = HTML.testCase_id
cmd = cls_cmd.getConnection(self.eNBIPAddress) cmd = cls_cmd.getConnection(self.testSvrId)
succeeded = OC_login(cmd, self.OCUserName, self.OCPassword, CI_OC_RAN_NAMESPACE) succeeded = OC_login(cmd, self.OCUserName, self.OCPassword, CI_OC_RAN_NAMESPACE)
if not succeeded: if not succeeded:
logging.error('\u001B[1m OC Cluster Login Failed\u001B[0m') logging.error('\u001B[1m OC Cluster Login Failed\u001B[0m')
......
...@@ -431,10 +431,12 @@ def GetParametersFromXML(action): ...@@ -431,10 +431,12 @@ def GetParametersFromXML(action):
RAN.command = test.findtext('command') RAN.command = test.findtext('command')
RAN.command_fail = test.findtext('command_fail') in ['True', 'true', 'Yes', 'yes'] RAN.command_fail = test.findtext('command_fail') in ['True', 'true', 'Yes', 'yes']
elif action == 'Pull_Cluster_Image': elif action == 'Pull_Cluster_Image':
# CLUSTER.imageToPull.clear()
string_field = test.findtext('images_to_pull') string_field = test.findtext('images_to_pull')
if (string_field is not None): if (string_field is not None):
CLUSTER.imageToPull = string_field.split() CLUSTER.imageToPull = string_field.split()
string_field = test.findtext('test_svr_id')
if (string_field is not None):
CLUSTER.testSvrId = string_field
else: else:
logging.warning(f"unknown action {action} from option-parsing point-of-view") logging.warning(f"unknown action {action} from option-parsing point-of-view")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment