diff options
| author | Yaguang Tang <yaguang.tang@canonical.com> | 2013-05-20 18:05:30 +0800 |
|---|---|---|
| committer | Yaguang Tang <yaguang.tang@canonical.com> | 2013-05-27 12:32:45 +0800 |
| commit | 4f44cd9129f094d88dfddfa5885c453590ac847c (patch) | |
| tree | 35b8cfb882c56dd742d21220ee814a0d22914d27 /nova/compute | |
| parent | e06ab5877462c83f6574b0304331e3ff906ddb14 (diff) | |
Fix config drive code logical error.
Image id has changed to uuid, so bool value can't be a image ID
any more, remove unnecessary test code.
fix bug #1181991
Change-Id: I420e4cdb848401375b347d43e06343efaa7bf5fc
Diffstat (limited to 'nova/compute')
| -rw-r--r-- | nova/compute/api.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py index eccf13da6..b7e5f5beb 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -477,19 +477,15 @@ class API(base.Base): return instance def _check_config_drive(self, context, config_drive): - bool_like = True try: - strutils.bool_from_string(config_drive, strict=True) + bool_like = strutils.bool_from_string(config_drive, strict=True) except ValueError: bool_like = False if config_drive is None: return None, None - elif bool_like and config_drive not in (0, 1, '0', '1'): - # NOTE(sirp): '0' and '1' could be a bool value or an ID. Since - # there are many other ways to specify bools (e.g. 't', 'f'), it's - # better to treat as an ID. - return None, config_drive + elif bool_like: + return None, bool_like else: cd_image_service, config_drive_id = \ glance.get_remote_image_service(context, config_drive) |
