On Friday August 14th. from 9 p.m. to 9:30 p.m., we will upgrade GitLab software and its cloud platform release. Service may not be available during this maintenance window. Please schedule your work accordingly.

Commit b30f09a6 authored by Marcello Golfieri's avatar Marcello Golfieri

parameterize tag option

parent 1e977f37
......@@ -140,6 +140,15 @@ class Qapi:
self.url = "https://" + self.qgc.server
self.scanners = ",".join(self.get_scanner_appliances_list())
self.cache = cache
self._tag = 'TCG'
@property
def tag(self):
return self._tag
@tag.setter
def tag(self, value):
self._tag = value
def _make_get_params(self, params):
if params:
......@@ -204,7 +213,7 @@ class Qapi:
raw_output=True,
)
def get_agents_by_tag_xml(self, tag="mg-TCG"):
def get_agents_by_tag_xml(self, tag):
params = """<ServiceRequest>
<filters>
<Criteria field="tagName" operator="EQUALS">{tag}</Criteria>
......@@ -271,7 +280,7 @@ class Qapi:
return software_list
def populate_agent_hosts(self):
oxml = self.get_agents_by_tag_xml()
oxml = self.get_agents_by_tag_xml(self.tag)
self.hosts = oxml.xpath("//data/HostAsset/dnsHostName")
self.hosts = [x.replace(".stanford.edu", "") for x in self.hosts]
......
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