Fix Windows support
With a single line change, we can use this cinder client extension on Windows. This patch will avoid the os.getuid call, which is unavailable on Windows. Note that on Windows, we aren't doing any privilege escalation, assuming that we already have the required rights. Here's a sample: http://paste.openstack.org/raw/802466/ Change-Id: Ic554b5df2adee38b97665c578ca69b33c8694ca7
This commit is contained in:
parent
0259467434
commit
26495b75bb
|
@ -30,7 +30,7 @@ Optional dependencies based on Cinder driver's protocol::
|
||||||
|
|
||||||
* open-iscsi, udev - for volume attachment via iSCSI
|
* open-iscsi, udev - for volume attachment via iSCSI
|
||||||
|
|
||||||
NOTE (e0ne): current version is tested only on Linux hosts
|
NOTE (e0ne): current version is tested on Linux and Windows hosts
|
||||||
|
|
||||||
For any other information, refer to the parent projects, Cinder and
|
For any other information, refer to the parent projects, Cinder and
|
||||||
python-cinderclient::
|
python-cinderclient::
|
||||||
|
|
|
@ -62,7 +62,7 @@ def get_root_helper():
|
||||||
|
|
||||||
def require_root(f):
|
def require_root(f):
|
||||||
def wrapper(*args, **kwargs):
|
def wrapper(*args, **kwargs):
|
||||||
if os.getuid() != 0:
|
if hasattr(os, 'getuid') and os.getuid() != 0:
|
||||||
raise exceptions.CommandError(
|
raise exceptions.CommandError(
|
||||||
"This command requires root permissions.")
|
"This command requires root permissions.")
|
||||||
return f(*args, **kwargs)
|
return f(*args, **kwargs)
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
Added Windows support.
|
Loading…
Reference in New Issue