3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
17 from .cliwrapperbase import CliWrapperBase
20 @six.add_metaclass(abc.ABCMeta) # pylint: disable=abstract-method
21 class CloudCliBase(CliWrapperBase):
24 def _target_kwargs(self):
25 return {'target': '{prebase}{os_cloud}.{cloudname}'.format(
26 prebase=self._prebase,
27 os_cloud=self._os_cloud,
28 cloudname=self._cloudname)}
37 if self._expected_target == 'default' else
38 '{}.'.format(self._expected_target))
45 def _expected_cmd_args(self):
46 return ' --os-cloud {} '.format(self._cloudname)
49 class TargetCloud(CloudCliBase):
52 def _expected_target(self):
56 class DefaultCloud(CloudCliBase):
59 def _expected_target(self):
63 class TypoCloud(CloudCliBase):
66 def _expected_target(self):
67 return 'target.{os_cloud}.{cloudname}'.format(
68 os_cloud=self._os_cloud,
69 cloudname=self._cloudname)
80 def _expected_cmd_args(self):
81 return ' --os-cloud default '