From: Frank Brehm Date: Wed, 25 Jan 2017 11:24:39 +0000 (+0100) Subject: Retrieving some properties from jason data X-Git-Tag: 0.8.4~52 X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=9028c8139f5554cc123587d8b150e6d26850e46f;p=pixelpark%2Fpuppetmaster-webhooks.git Retrieving some properties from jason data --- diff --git a/lib/webhooks/deploy.py b/lib/webhooks/deploy.py index 126afed..0aa1e4d 100644 --- a/lib/webhooks/deploy.py +++ b/lib/webhooks/deploy.py @@ -63,6 +63,10 @@ class WebhookDeployApp(object): self.data = None self.json_data = None + self.ref = None + self.namespace = None + self.name = None + self.full_name = None self._log_directory = os.sep + os.path.join('var', 'log', 'webhooks') @@ -244,6 +248,12 @@ class WebhookDeployApp(object): sys.exit(0) LOG.debug("Got JSON data:\n{}".format(pp(self.json_data))) + + self.ref = self.json_data['ref'].split('/')[-1] + self.namespace = self.json_data['project']['namespace'] + self.name = self.json_data['project']['name'] + self.full_name = self.json_data['project']['path_with_namespace'] + sys.exit(0) # =============================================================================