summaryrefslogtreecommitdiff
path: root/tools/read-dependencies
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2015-02-10 20:53:20 -0500
committerScott Moser <smoser@ubuntu.com>2015-02-10 20:53:20 -0500
commitcd632b2f153a61faa48531cb41d0288650e72c71 (patch)
treea3a35b9ca437d999a15fdd25c0a0de88e3cafafb /tools/read-dependencies
parent78915c97c18d678db10e0fde0d9306823c5f4610 (diff)
parentf5f280cae778bd214b91664f28d9eed997fbcda5 (diff)
downloadvyos-cloud-init-cd632b2f153a61faa48531cb41d0288650e72c71.tar.gz
vyos-cloud-init-cd632b2f153a61faa48531cb41d0288650e72c71.zip
python3 support.
This gives us functional python3 support. There are likely still bugs, but instance boot on openstack is functional now. LP: #1247132
Diffstat (limited to 'tools/read-dependencies')
-rwxr-xr-xtools/read-dependencies10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/read-dependencies b/tools/read-dependencies
index fee3efcf..6a6f3e12 100755
--- a/tools/read-dependencies
+++ b/tools/read-dependencies
@@ -1,6 +1,7 @@
#!/usr/bin/env python
import os
+import re
import sys
if 'CLOUD_INIT_TOP_D' in os.environ:
@@ -14,10 +15,15 @@ for fname in ("setup.py", "requirements.txt"):
"exist in cloud-init root directory." % fname)
sys.exit(1)
-with open(os.path.join(topd, "requirements.txt"), "r") as fp:
+if len(sys.argv) > 1:
+ reqfile = sys.argv[1]
+else:
+ reqfile = "requirements.txt"
+
+with open(os.path.join(topd, reqfile), "r") as fp:
for line in fp:
if not line.strip() or line.startswith("#"):
continue
- sys.stdout.write(line)
+ sys.stdout.write(re.split("[>=.<]*", line)[0].strip() + "\n")
sys.exit(0)