Skip to content

Commit

Permalink
specify the path prefix in args
Browse files Browse the repository at this point in the history
  • Loading branch information
bmidgley committed Nov 11, 2014
1 parent a43af05 commit f61e1ea
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions iron_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def __init__(self, name, version, product, host=None, project_id=None,
config = configFromFile(config, config_file, product)
config = configFromArgs(config, host=host, project_id=project_id,
token=token, protocol=protocol, port=port,
api_version=api_version, keystone=keystone, cloud=cloud)
api_version=api_version, keystone=keystone, cloud=cloud, path_prefix=path_prefix)

required_fields = ["project_id"]

Expand Down Expand Up @@ -162,6 +162,7 @@ def __init__(self, name, version, product, host=None, project_id=None,
"Accept": "application/json",
"User-Agent": "%s (version: %s)" % (self.name, self.version)
}
self.path_prefix = config["path_prefix"]

if self.cloud is not None:
url = urlparse(self.cloud)
Expand All @@ -178,9 +179,6 @@ def __init__(self, name, version, product, host=None, project_id=None,
self.port, self.path_prefix, self.api_version)
if self.project_id:
self.base_url += "projects/%s/" % self.project_id
if self.protocol == "https" and self.port != 443:
raise ValueError("Invalid port (%s) for an HTTPS request. Want %s."
% (self.port, 443))

def _doRequest(self, url, method, body="", headers={}):
if self.token or self.keystone:
Expand Down

0 comments on commit f61e1ea

Please sign in to comment.