diff options
author | Amy Fong <amy.fong@windriver.com> | 2014-05-23 13:43:14 -0400 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2014-05-24 00:27:14 -0400 |
commit | 4a70d93624a1397c1e03a4f6c494e20757c53f8c (patch) | |
tree | a7f6271c4f177b3e0cba8e32ca76123ba417508b /meta-openstack/classes | |
parent | 9643550aa09597778fbbfc30d93987a247f5a63b (diff) | |
download | meta-cloud-services-4a70d93624a1397c1e03a4f6c494e20757c53f8c.tar.gz |
ruby.bbclass is incompatible with older python
subprocess.check_output() doesn't exist in older python2.6*
Rewriting as subprocess.Popen
Signed-off-by: Amy Fong <amy.fong@windriver.com>
Diffstat (limited to 'meta-openstack/classes')
-rw-r--r-- | meta-openstack/classes/ruby.bbclass | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/meta-openstack/classes/ruby.bbclass b/meta-openstack/classes/ruby.bbclass index 0f20deb..09baebd 100644 --- a/meta-openstack/classes/ruby.bbclass +++ b/meta-openstack/classes/ruby.bbclass | |||
@@ -13,7 +13,7 @@ RDEPENDS_${PN} += " \ | |||
13 | def get_rubyversion(p): | 13 | def get_rubyversion(p): |
14 | import re | 14 | import re |
15 | from os.path import isfile | 15 | from os.path import isfile |
16 | from subprocess import check_output | 16 | import subprocess |
17 | found_version = "SOMETHING FAILED!" | 17 | found_version = "SOMETHING FAILED!" |
18 | 18 | ||
19 | cmd = "%s/ruby" % p | 19 | cmd = "%s/ruby" % p |
@@ -21,7 +21,7 @@ def get_rubyversion(p): | |||
21 | if not isfile(cmd): | 21 | if not isfile(cmd): |
22 | return found_version | 22 | return found_version |
23 | 23 | ||
24 | version = check_output([cmd, "--version"]) | 24 | version = subprocess.Popen([cmd, "--version"], stdout=subprocess.PIPE).communicate()[0] |
25 | 25 | ||
26 | r = re.compile("ruby ([0-9]+\.[0-9]+\.[0-9]+)*") | 26 | r = re.compile("ruby ([0-9]+\.[0-9]+\.[0-9]+)*") |
27 | m = r.match(version) | 27 | m = r.match(version) |
@@ -33,7 +33,7 @@ def get_rubyversion(p): | |||
33 | def get_rubygemslocation(p): | 33 | def get_rubygemslocation(p): |
34 | import re | 34 | import re |
35 | from os.path import isfile | 35 | from os.path import isfile |
36 | from subprocess import check_output | 36 | import subprocess |
37 | found_loc = "SOMETHING FAILED!" | 37 | found_loc = "SOMETHING FAILED!" |
38 | 38 | ||
39 | cmd = "%s/gem" % p | 39 | cmd = "%s/gem" % p |
@@ -41,10 +41,10 @@ def get_rubygemslocation(p): | |||
41 | if not isfile(cmd): | 41 | if not isfile(cmd): |
42 | return found_loc | 42 | return found_loc |
43 | 43 | ||
44 | loc = check_output([cmd, "env"]).split('\n') | 44 | loc = subprocess.Popen([cmd, "env"], stdout=subprocess.PIPE).communicate()[0] |
45 | 45 | ||
46 | r = re.compile(".*\- (/usr.*/ruby/gems/.*)") | 46 | r = re.compile(".*\- (/usr.*/ruby/gems/.*)") |
47 | for line in loc: | 47 | for line in loc.split('\n'): |
48 | m = r.match(line) | 48 | m = r.match(line) |
49 | if m: | 49 | if m: |
50 | found_loc = m.group(1) | 50 | found_loc = m.group(1) |
@@ -55,7 +55,7 @@ def get_rubygemslocation(p): | |||
55 | def get_rubygemsversion(p): | 55 | def get_rubygemsversion(p): |
56 | import re | 56 | import re |
57 | from os.path import isfile | 57 | from os.path import isfile |
58 | from subprocess import check_output | 58 | import subprocess |
59 | found_version = "SOMETHING FAILED!" | 59 | found_version = "SOMETHING FAILED!" |
60 | 60 | ||
61 | cmd = "%s/gem" % p | 61 | cmd = "%s/gem" % p |
@@ -63,7 +63,7 @@ def get_rubygemsversion(p): | |||
63 | if not isfile(cmd): | 63 | if not isfile(cmd): |
64 | return found_version | 64 | return found_version |
65 | 65 | ||
66 | version = check_output([cmd, "env", "gemdir"]) | 66 | version = subprocess.Popen([cmd, "env", "gemdir"], stdout=subprocess.PIPE).communicate()[0] |
67 | 67 | ||
68 | r = re.compile(".*([0-9]+\.[0-9]+\.[0-9]+)$") | 68 | r = re.compile(".*([0-9]+\.[0-9]+\.[0-9]+)$") |
69 | m = r.match(version) | 69 | m = r.match(version) |