This commit makes 'log' optional.
'log' attribute of each command class does not exist
when the class is defined because 'log' is now setup
dynamically when a class is instantiated. Instead log_method
looks for a logger from a decorating method.
compute.v2.server is changed in this commit as an example.
Change-Id: Ic4d128f8e027d3b8e6f884f31369e9085c0f0871
Partial-Bug: #1532294
Update the "os availability zone list" command to support listing
volume availability zones along with the currently listed compute
availability zones. This adds a --compute and --volume option to
the command in order to select the availability zones to list. By
default, all availability zones are listed.
If the Block Storage API does not support listing availability
zones then an warning message will be issued.
Change-Id: I8159509a41bd1fb1b4e77fdbb512cf64a5ac11a9
Closes-Bug: #1532945
Refactor the "os availability zone list" command to make it a common
command instead of a compute-only command. Since availability zones
are common to compute, volume and network (new), this refactoring
allows availability zone support to be added for volume and network.
In addition to the refactor, unit and functional tests were added.
Change-Id: I63e9d41d229b21cd38e5a083493042c096d65e05
Partial-Bug: #1532945
Move the network endpoint enablement checking from the 'server create'
command to the common client manager. This allows future network
commands to use either nova or neutron networking based on the cloud
environment.
This patch set also includes related unit test enhancements to the
common client manager to trigger authentication on the tests.
Change-Id: Ia37e81d4fb05a1e2fceb3e5d367bda769ab8e64b
Related-Bug: #1519511
Related-to: blueprint neutron-client
string_to_bool() is not used by anyone.
Furthermore, it is not well designed. It tries to convirt 't', '1'
to True, which could be confused.
So remove it. If we need something similar, let's make a better one.
Change-Id: Ic1f63480c806bf7bcc9f541fc806eed297ddf718
* Change session imports to keystoneauth1
* Change keystoneclient.exception imports to keystoneauth1
* Change exceptions raised from internal API from keystoneclient to openstack.common
Change-Id: I046d89f561d6fe04baae53726f9749d2e7fe2056
A validation is necessary to check the existence of project.
This patch is similar to Ia2d8c96527820e25b074e6486d3f39c5ad7eae60.
Change-Id: Id8895ba7a21ecad05942619a82a87c0dc68eae53
The OpenStackClient mapping of 'openstack quota set' arguments isn't
correct for compute quota items that have to different names. For
example, the --injected-file-size argument is mapped to
injected_file_size, but the compute quotas item is actually
injected_file_content_bytes. This incorrect mapping prevented the
impacted compute quota items from being set.
The problem impacts the following 'openstack quota set' arguments:
--injected-file-size
--injected-path-size
--properties
--secgroup-rules
--secgroups
This patch set also expands the compute quota unit tests to verify
all compute quota items that can be set.
Change-Id: I0a2f241e425f4811e4ae55be183ac0c8b0805c2a
Closes-Bug: #1475831
For some apis, heat, the error status is "failed". This patch
changes the wait_for_status method to allow for the error
status to be passed in the same way as the success status.
Change-Id: I20db4051d3f5611a4b13fe23ea8798b82a40da81
skip properties that are non-ascii values, but proceed
with properties that work. log these failed values back
to the user.
Change-Id: Iaca8909f4465a01c8aebfd290b1a322823702359
Closes-Bug: 1503898
The behaviors are inconsistent while different
negative line numbers specified.
Change-Id: I2573f3e789f5603c896758971830ffc0b94c5e2b
Closes-Bug: #1512263
The quota info would be set into DB, even though the project actually
does not exist.
This patch tried to add a validation to forbid this undesirable behavior.
Change-Id: Ia2d8c96527820e25b074e6486d3f39c5ad7eae60
Closes-Bug: #1512638
At one point this file contained the context for logging, but
the reason for its existence is now for logging.
Implements: blueprint logging-migration
Change-Id: I4ba42bbef97b09d31236ac8c01b6fb23827b8bee
add a last-ditch effort to find the resource in question by
listing all the resources and doing a simply match for name and
id. if no match is found then raise an error, if the list call
is unsuccessful, raise the same error. we have failed this city.
Closes-Bug: #1501362
Change-Id: I0d3d7002e9ac47b17b1ef1a5534406c85b1fc753
A few things here: 1) we need to check if the client class even
has a 'resource_class', in the case of glanceclient, it does not.
2) If everything fails we should print a better error message,
rather than a "find" failed, since some clients don't support find.
Change-Id: I6277322639e75b1635f9f3d159753efadbce1031
Instead of duplicating the same log statement throughout
the code, the same logic can be provided by a shared decorator
that abstracts away the logging capability and unifies it behind
a common function instead.
Change-Id: Icc63bced7347c8bbf0299a4c5821425a10892a79
Configuration of logging gets triggered twice. The first time it
uses the CLI options when the application is started and second
it uses the configuration file after that is read. The state of
the logging needs to be saved from the first to the second time,
so I created a class.
Implements: blueprint logging-migration
Change-Id: I7b8d1a3b6fd128e98cafd7c16009c7b694a52146
Running limits show without --absolute or --rate returns nothing and
the user is left to figure out what they need to provide to get the
correct data back. This patch prints an error and help output by making
at least one of the arguments required.
Change-Id: I576cf8ec0e05524ee67d46c48b56da8d44258667
There is no way to change the configuration variables we want
printed in log messages, so format them in the constructor.
This will save us from overridding the format method and
a couple cpu cycles every log message. This change also moves
the _LOG* variables into the formatter since they aren't really
globally needed.
Change-Id: I706e9db7da3daec20332f9d1533fe665f2739dea
Implements: blueprint logging-migration
Extract log_level from configuration file if the level was not
overridden by the command line option. The default command line
option is 1 and there is no command line option to set the
verbose_level to 1, so if it is 1, it has not be set.
Change-Id: I1be04367c72f83c1181f92ca4c2c83165b66995c
Implements: blueprint logging-migration
Move the conversion of command line options to log level out
of shell.py.
Change-Id: I86cb45a85cd63927aa1c87c1eed27542981df659
Implements: blueprint logging-migration