From dcf2ce1b8cd039b3a13e7c70ef94ce968ffc4de0 Mon Sep 17 00:00:00 2001 From: Thomas Duval Date: Wed, 22 Nov 2017 11:26:41 +0100 Subject: Add waiting code for Keystone, re-add the ability to connect a PDP to the "admin" Keystone project and fix some bugs Change-Id: Ic3afdb1306a72bd09f9071e96aabfae602153e94 --- moonv4/templates/moonforming/utils/policies.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'moonv4/templates/moonforming/utils/policies.py') diff --git a/moonv4/templates/moonforming/utils/policies.py b/moonv4/templates/moonforming/utils/policies.py index df7f5f57..bd08291a 100644 --- a/moonv4/templates/moonforming/utils/policies.py +++ b/moonv4/templates/moonforming/utils/policies.py @@ -1,7 +1,9 @@ +import logging import requests import utils.config config = utils.config.get_config_data() +logger = logging.getLogger("moonforming.utils.policies") URL = "http://{}:{}".format(config['components']['manager']['hostname'], config['components']['manager']['port']) URL = URL + "{}" @@ -108,10 +110,13 @@ def delete_policy(policy_id): def add_subject(policy_id=None, name="test_subject"): subject_template['name'] = name if policy_id: + logger.debug(URL.format("/policies/{}/subjects".format(policy_id))) req = requests.post(URL.format("/policies/{}/subjects".format(policy_id)), json=subject_template, headers=HEADERS) else: + logger.debug(URL.format("/subjects")) req = requests.post(URL.format("/subjects"), json=subject_template, headers=HEADERS) + logger.debug(req.text) assert req.status_code == 200 result = req.json() assert "subjects" in result -- cgit 1.2.3-korg