diff options
| author | Joanna Taryma <joanna.taryma@intel.com> | 2016-12-21 15:35:11 +0100 |
|---|---|---|
| committer | Joanna Taryma <joanna.taryma@intel.com> | 2016-12-23 16:13:25 +0100 |
| commit | 83a19a4844daca4f0e3fe9fcdbf925328f0f4429 (patch) | |
| tree | 8cffdd31b8f0c5ce19a83c33479f269aece6c731 /ironic_python_agent/config.py | |
| parent | 4f1669dbaf3f10fac7c00df8ca691f63d754a8e5 (diff) | |
| download | ironic-python-agent-83a19a4844daca4f0e3fe9fcdbf925328f0f4429.tar.gz | |
Fail IPA startup if no protocol prefix in ironic api address
Add regex validation of api_url specified in configuration file.
Oslo config will raise exception if no supported protocol prefix
is included in Ironic api address in configuration file.
Supported protocols are http and https.
Closes-Bug: #1630785
Change-Id: I437b4ea0a2995921ddede03bc670087fdbbc8b83
Diffstat (limited to 'ironic_python_agent/config.py')
| -rw-r--r-- | ironic_python_agent/config.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ironic_python_agent/config.py b/ironic_python_agent/config.py index 6c5ca963..2fccb3a2 100644 --- a/ironic_python_agent/config.py +++ b/ironic_python_agent/config.py @@ -25,8 +25,10 @@ cli_opts = [ cfg.StrOpt('api_url', default=APARAMS.get('ipa-api-url'), deprecated_name='api-url', + regex='^http(s?):\/\/.+', help='URL of the Ironic API. ' - 'Can be supplied as "ipa-api-url" kernel parameter.'), + 'Can be supplied as "ipa-api-url" kernel parameter.' + 'The value must start with either http:// or https://.'), cfg.StrOpt('listen_host', default=APARAMS.get('ipa-listen-host', '0.0.0.0'), |
