diff options
author | Thomas Duval <thomas.duval@orange.com> | 2017-11-22 11:26:41 +0100 |
---|---|---|
committer | Thomas Duval <thomas.duval@orange.com> | 2017-11-22 11:26:41 +0100 |
commit | dcf2ce1b8cd039b3a13e7c70ef94ce968ffc4de0 (patch) | |
tree | 5bf8e2a2071525c28f76b99a0e1eec8945528a66 /moonv4/templates/moonforming/utils/policies.py | |
parent | cb739df188d2c7c465a3d4fbc857c6417e2a3073 (diff) |
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
Diffstat (limited to 'moonv4/templates/moonforming/utils/policies.py')
-rw-r--r-- | moonv4/templates/moonforming/utils/policies.py | 5 |
1 files changed, 5 insertions, 0 deletions
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 |