Skip to content

Commit

Permalink
Merge pull request #179 from mshriver/fix-rhevm-list-vms-4457
Browse files Browse the repository at this point in the history
[RFR] Update rhevm api kwargs, <4.0 vs >4.0
  • Loading branch information
jkrocil authored Sep 13, 2017
2 parents 6ad5959 + 8f01f89 commit 8d50619
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions wrapanapi/rhevm.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ class RHEVMSystem(WrapanapiAPIBase):
def __init__(self, hostname, username, password, **kwargs):
# generate URL from hostname
super(RHEVMSystem, self).__init__(kwargs)
url_component = 'ovirt-engine/api' if float(kwargs['version']) >= 4.0 else 'api'
less_than_rhv_4 = float(kwargs['version']) < 4.0
url_component = 'api' if less_than_rhv_4 else 'ovirt-engine/api'
if 'api_endpoint' in kwargs:
url = kwargs['api_endpoint']
elif 'port' in kwargs:
Expand All @@ -109,9 +110,8 @@ def __init__(self, hostname, username, password, **kwargs):
'url': url,
'username': username,
'password': password,
'filter': True,
'insecure': True
}
'insecure': True,
'filter': True if less_than_rhv_4 else False}
self.kwargs = kwargs

@property
Expand Down

0 comments on commit 8d50619

Please sign in to comment.