Add way to specify key-name from environ

If you're using a standard SSH keypair, it becomes tedious to have to type
`--key-name` for every novaclient command.

This patch introduces a new environment variable `NOVACLIENT_DEFAULT_KEY_NAME`
which can be used to set this value persistently.

Change-Id: I1a1180b7d474d1a4e039dbb7044cd8eaf04cc9ad
Closes-Bug: 1327418
Adding cornercases for set_metadata

Aggregate_set_metadata leaves users confused because it currently
does not check for duplicate key=value parameters for addition
or a missing key for deletion. All that user sees is that "metadata has been updated"
more details in bug1292572

This patch checks for above mentioned corner cases and informs users when and why
there was no change made in above corner cases

Adding better testcases also.

   Closes-Bug: #1292572

Change-Id: I820d793ac44680295df8b2a3f58a0834f7019875
'policy' should be required in server_group_create

The 'policies' param is a required param in nova api now.
So, we also need to change it in cli.

After the modification, the 'policy' param will be required now,
and the old '--policy' style will still be available.

Change-Id: I97921eef0f635c8d50a04bbdaf3ef4f1bfaa3e9d
Closes-Bug: #1323909
"nova boot" should not log an error if subsidiary commands fail

Fix:
Intially the cli was raising "CommadError" in case the requested
flavor or image were not present.
This error category was not approrpiate as it signifies an error
in the command syntax. When the requested resource (flavour/image)
does not exist, a ResourceNotFound error should be raised. So,
added a new error category "ResourceNotFound" to cater for this
scenario and updated the code to raise this new error.
"nova show <instance_name>" command has also been updated to raise
"ResourceNotFound" error when the requested vm for which details
have to be displayed does not exist.

Closes-Bug: #1258488
Change-Id: If64a087944586ef5792efe3baa62e455b9bbaa07
Enable F841

F841 detects local variable is assigned to but never used.
This commit fix the violations and enable F841 in gate.

Change-Id: I52419f5e17db70e511ff2d4d61c85458c958e9c3
Look for all accessible flavors by default, not just public ones

The Nova server will restrict unprivileged user accounts to just
public images, while allowing administrator accounts access to
all. The Nova client shouldn't force the flavor name lookup to
be restricted to just public images, since that breaks the ability
to the flavor name when booting an instance

Fixes bug #1327212

Change-Id: I949aec52660242249b8cba51d77bfdc1acaf31d2
Allow updating fixed_ips quotas in quota-class-update (v2 shell only)

The quota-class-update command wasn't allowing updating quotas for
fixed_ips which is a supported key for the os-quota-class-sets API.

This change adds the support to update qoutas for fixed_ips and updates
the existing test to be more robust in (a) the quota keys it's testing
and (b) the request body it's asserting.

This is a v2-only change since the os-quota-class-sets API was removed
from the nova v3 API in Icehouse.

Closes-Bug: #1330571

Change-Id: Ifcca6d00551619b993b96f05134980a4ca2f2acf
Updated from global requirements

Change-Id: I7645c469147b0ff235aaf96fd6f6f2df68505ea4
Add some security group tests for the V1_1 API

This patch adds a test for NoUniqueMatch exception
to the v1_1 API

Change-Id: Ic9947eaed34be100c529f021432f0c388a7c3ddb
Closes-Bug: #1250501
Merge "Enable F841"
Overhaul bash-completion to support non-UUID based IDs

There are a few things currently wrong with bash-completion as it stands now:

    1) IDs are currently required to be UUIDs. This is an arbitrary limitation
       and doesn't make sense for certain kinds of objects, like `Flavors`
       where a valid ID could be `performance-16gb`.

    2) The code is spread out between Oslo's `Resource` and Novaclient's
       `Manager` class. This makes it difficult to improve the code because it
       requires changes to two separate projects. We should centralize the
       code in Novaclient until the API is stable, then import the code into
       Oslo in its entirety, not partially like it is now.

    3) The completion code is handled by the `Manager` of which there is one
       per Resource-type. In the interest of centralizing this functionality,
       we should create a `CompletionCache` class and hang it off of `Client`
       of which there is one-per-session.

    4) The completion-code currently runs by default even in headless mode
       (e.g. novaclient without the shell). It'd be much more efficient to
       only write to the completion cache if we're accessing the `Client` from
       the novaclient shell. We can make this an option to support third-party
       CLI clients that want to use the completion-cache as well.

NOTE:
    * The corresponding Oslo patch is here:

        https://review.openstack.org/#/c/101376/

    * This patch was tested in multithreaded mode to prevent any regression
      from:

        https://bugs.launchpad.net/python-novaclient/+bug/1213958.

Change-Id: Idada83de103358974b739f81d4f392574f9e1237
Closes-Bug: 1332270
Sync Oslo's apiclient

Oslo's version of apiclient fixes a bug where if `human_id` is `None` it
causes `novaclient` to crash, so lets sync it over to fix that bug.

Change-Id: I53f174a1d3356c4038dcbdf88f4f9c4ea179418c
References-Bug: 1288397
Merge "Add some security group tests for the V1_1 API"
Merge "Updated from global requirements"
Fix listing of Server in floating-ip-list

Add a translation from instance_id to server_id to accommodate
for the adjusted user output.

Closes-Bug: #1324857

Change-Id: Ifaa15f6907b5efae7431eb1741b7fae4b3540a8c
Merge ""nova boot" should not log an error if subsidiary commands fail"
Merge "Look for all accessible flavors by default, not just public ones"
add disk bus and device type to volume attach

This change adds the optional parameters: disk bus and device type
to the volume-attach command for the V3 API.

DocImpact
Closes-Bug: #1303875

Change-Id: I4fd07726887d08e5b669139b559bdb2c2d21826e
Convert floating IP pool tests to httpretty

Change-Id: Ic9332ddd30a0bc3ffc5ed7c046f60ded3f940e85
blueprint: httpretty-testing
Convert server tests to httpretty

Change-Id: If18980fbe94cee389b7dab9925fdad8f920f9885
blueprint: httpretty-testing