- self.logger.warning("Couldn't resolve service endpoints: http_endpoint={} rmr_endpoint={}".format(http_endpoint, rmr_endpoint))
- return None
- try:
- request_string = {
- "appName": hostname,
- "httpEndpoint": http_endpoint,
- "rmrEndpoint": rmr_endpoint,
- "appInstanceName": xappname,
- "appVersion": xappversion,
- "configPath": self._config_data.get("CONFIG_PATH")
- }
- request_body = json.dumps(request_string)
- except TypeError:
- self.logger.error("Unable to serialize the object")
- return "Error searializing the object"
-
- return self.do_post(pltnamespace, self._config_data.get("REGISTER_PATH"), request_body)
+ self.logger.error(
+ "Couldn't resolve service endpoints: http_endpoint={} rmr_endpoint={}".format(http_endpoint,
+ rmr_endpoint))
+ return False
+ self.logger.debug(
+ "config details hostname : {} xappname: {} xappversion : {} pltnamespace : {} http_endpoint : {} rmr_endpoint "
+ ": {} configpath : {}".format(hostname, xappname, xappversion, pltnamespace, http_endpoint, rmr_endpoint,
+ self._config_data.get("CONFIG_PATH")))
+ request_string = {
+ "appName": hostname,
+ "appVersion": xappversion,
+ "configPath": "",
+ "appInstanceName": xappname,
+ "httpEndpoint": http_endpoint,
+ "rmrEndpoint": rmr_endpoint,
+ "config": json.dumps(self._config_data)
+ }
+ self.logger.info("REQUEST STRING :{}".format(request_string))
+ return self.do_post(pltnamespace, Constants.REGISTER_PATH, request_string)