You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2020/05/01 15:41:28 UTC

[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #4671: Ciab atstccfg

ocket8888 commented on a change in pull request #4671:
URL: https://github.com/apache/trafficcontrol/pull/4671#discussion_r418598106



##########
File path: infrastructure/cdn-in-a-box/ort/traffic_ops_ort/to_api.py
##########
@@ -113,37 +152,21 @@ def getMyPackages(self) -> typing.List[packaging.Package]:
 		"""
 		logging.info("Fetching this server's package list from Traffic Ops")
 
-		# Ah, read-only properties that gut functionality, my favorite.
-		tmp = self.api_base_url
-		self._api_base_url = urljoin(self._server_url, '/').rstrip('/') + '/'
-
-		packagesPath = '/'.join(("ort", self.hostname, "packages"))
+		atstccfg_cmd = self.atstccfg_cmd + ["--get-data=packages"]
 		for _ in range(self.retries):
 			try:
-				myPackages = self.get(packagesPath)
-				break
-			except (LoginError, OperationError, InvalidJSONError, RequestException) as e:
+				proc = subprocess.run(atstccfg_cmd, stderr=subprocess.PIPE, stdout=subprocess.PIPE)
+				logging.debug("Raw output: %s", proc.stdout.decode())
+				if proc.stderr.decode():
+					logging.error("proc.stderr.decode()")
+				if proc.returncode == 0:
+					return [Package(p) for p in json.loads(proc.stdout.decode())]

Review comment:
       Oh, looks like I didn't do that. Weird, because I think this was like that before and I didn't change that import...




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org