]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Fix processutils.execute errors on windows
authorAlessandro Pilotti <apilotti@cloudbasesolutions.com>
Tue, 24 Sep 2013 23:30:33 +0000 (02:30 +0300)
committerAlessandro Pilotti <apilotti@cloudbasesolutions.com>
Tue, 24 Sep 2013 23:57:44 +0000 (02:57 +0300)
Added a check for existence of geteuid.

This fix is related to oslo-incubator commit:
d6a963e911b8456c06dceb5ee3cc88a70c08bf82

Fixes bug #1209410

Change-Id: Idd716a2104ba3fa24610825ce4bf9c8e2c6d490b

cinder/openstack/common/processutils.py

index dd6e73122d1592c2c54d19ca46ab0a109d32c52b..059f570b1202e6279d465701d4f04bf9c89c52b5 100644 (file)
@@ -127,7 +127,7 @@ def execute(*cmd, **kwargs):
         raise UnknownArgumentError(_('Got unknown keyword args '
                                      'to utils.execute: %r') % kwargs)
 
-    if run_as_root and os.geteuid() != 0:
+    if run_as_root and hasattr(os, 'geteuid') and os.geteuid() != 0:
         if not root_helper:
             raise NoRootWrapSpecified(
                 message=('Command requested root, but did not specify a root '