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:
self.ranTargetBranch = ""
self.cmd = None
self.imageToPull = ''
self.testSvrId = None
def _recreate_entitlements(self):
# recreating entitlements, don't care if deletion fails
......@@ -195,12 +196,13 @@ class Cluster:
self.cmd.run(f'oc delete -f {filename}')
def PullClusterImage(self, HTML, RAN):
if self.testSvrId == None: self.testSvrId = self.eNBIPAddress
if self.imageToPull == '':
HELP.GenericHelp(CONST.Version)
HELP.EPCSrvHelp(self.imageToPull)
sys.exit('Insufficient eNB Parameters')
sys.exit('Insufficient Parameter')
logging.debug(f'Pull OC image {self.imageToPull} to server {self.testSvrId}')
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)
if not succeeded:
logging.error('\u001B[1m OC Cluster Login Failed\u001B[0m')
......
......@@ -431,10 +431,12 @@ def GetParametersFromXML(action):
RAN.command = test.findtext('command')
RAN.command_fail = test.findtext('command_fail') in ['True', 'true', 'Yes', 'yes']
elif action == 'Pull_Cluster_Image':
# CLUSTER.imageToPull.clear()
string_field = test.findtext('images_to_pull')
if (string_field is not None):
CLUSTER.imageToPull = string_field.split()
string_field = test.findtext('test_svr_id')
if (string_field is not None):
CLUSTER.testSvrId = string_field
else:
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