diff options
| author | Jeffrey Zhang <zhang.lei.fly@gmail.com> | 2016-01-21 16:23:10 +0800 |
|---|---|---|
| committer | Jeffrey Zhang <jeffrey.zhang@99cloud.net> | 2016-02-15 15:25:15 +0800 |
| commit | da0f0cf1e672c42edf69f0a7080338c25b61706c (patch) | |
| tree | 76ecb88291e9de0713b79e33758cc45ec3557821 /kolla/cmd | |
| parent | 477fc18bd0febb2d53c0c5053ccff76ae1589d25 (diff) | |
| download | kolla-da0f0cf1e672c42edf69f0a7080338c25b61706c.tar.gz kolla-da0f0cf1e672c42edf69f0a7080338c25b61706c.zip | |
fix the custom profile raise exception issue
Closes-Bug: #1536272
Change-Id: I6c91e522923eade16ba23711e6014e6b4b8cd3e0
Diffstat (limited to 'kolla/cmd')
| -rwxr-xr-x | kolla/cmd/build.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/kolla/cmd/build.py b/kolla/cmd/build.py index 120220331..dcbef7718 100755 --- a/kolla/cmd/build.py +++ b/kolla/cmd/build.py @@ -493,7 +493,15 @@ class KollaWorker(object): if self.conf.profile: for profile in self.conf.profile: - filter_ += self.conf.profiles[profile] + if profile not in self.conf.profiles: + self.conf.register_opt(cfg.ListOpt(profile, + default=[]), + 'profiles') + if len(self.conf.profiles[profile]) == 0: + msg = 'Profile: {} does not exist'.format(profile) + raise ValueError(msg) + else: + filter_ += self.conf.profiles[profile] if filter_: patterns = re.compile(r"|".join(filter_).join('()')) |
