Commit 1cf24bbf authored by Dmitry Volodin's avatar Dmitry Volodin
Browse files

Merge branch 'patch-avs-win-compat' into 'master'

Add Windows compatible which command.

See merge request noc/noc!6229
parents 4f7b0b89 bcf0b405
Pipeline #36105 passed with stages
in 35 minutes and 42 seconds
......@@ -17,6 +17,9 @@ from noc.config import config
CHANGESET_LEN = 8
BRAND_PATH = config.get_customized_paths("BRAND", prefer_custom=True)
WHICH = "which"
if os.name == "nt":
WHICH = "where"
class cachedproperty(object):
......@@ -44,7 +47,7 @@ class Version(object):
"""
if os.path.exists(".git"):
with open(os.devnull, "w") as null:
return subprocess.call(["which", "git"], stdout=null) == 0
return subprocess.call([WHICH, "git"], stdout=null) == 0
return False
@cachedproperty
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment