commit | 80f12665e82eecfe496087420a719cc2fb90005e | [log] [tgz] |
---|---|---|
author | Scott Baker <smbaker@gmail.com> | Tue Sep 08 17:23:38 2015 -0700 |
committer | Scott Baker <smbaker@gmail.com> | Tue Sep 08 17:23:38 2015 -0700 |
tree | 4af4bc15b4db7d65208cace4e25c2d505d7b394b | |
parent | 935ad851b3a092665d16a073280268ae81796036 [diff] |
fix flavor rounding away MB
diff --git a/xos/tosca/flavorselect.py b/xos/tosca/flavorselect.py index 36024f9..2f40bcf 100644 --- a/xos/tosca/flavorselect.py +++ b/xos/tosca/flavorselect.py
@@ -18,7 +18,11 @@ return int(s) def get_mb(self, s): - return self.get_gb(s) * 1024 + if "GB" in s: + return int(s.split("GB")[0].strip())*1024 + if "MB" in s: + return int(s.split("MB")[0].strip()) + return int(s) def get_flavor(self): flavor = "m1.tiny"