Avoid modifying default function arguments

Modifying passed arguments inadvertently is an easy pitfall in python.
Even more serious is modifying the default value to a function, since
that modification will be preserved across future function calls.

The typical defense against the latter is to avoid using mutable default
values.

This change replaces several def foo(bar=[]) with bar=() or similar, and
then fixes a few cases that were exposed where the argument was indeed
permanently modified.

Change-Id: I3d04dcb39e3816942f8e80ce499c47d774a773c6
neutronclient shows low-level logs in console screen

Neutron command lines always display some useless information. This
should be avoided. This commit modifies the default level of console
stream to WARNING.

Closes-bug: #1356735

Change-Id: I997dad9ce3fc3eb795e4e44b27d211fa619c1907
Rename --timeout param to --http-timeout

The --timeout parameter was already used by the
load balancer subcommand so adding it as a top-level
parameter broke the load balancer commands. This
patch renames the new --timeout top-level command
to --http-timeout so it doesn't conflict with the
existing load balancer commands.

DocImpact

Closes-Bug: #1353536
Change-Id: I3d1dd9537e546191c5905e0aa5415de5308d9c7e
Repeat add-tenant and remove-tenant option in cli

For cisco-network-profile-create and cisco-network-profile-update cli,
add repeatable add-tenant and remove-tenant options so that user can
add and remove multiple tenants in a single cli request.

This fix includes changes in neutron, python-neutronclient and horizon.
All the changes should be merged at the same time

Implements: blueprint cisco-network-profile-multi-tenants-support
Change-Id: Ia902426b10d22a757ebbf62249dc28e9909dbff0
Refactor CreateRouter to use update_dict

At this point in time, 'distributed' is a positional argument and
thus doesn't need to be moved into the resource body.

Change-Id: I1d5c7c360fc76b5da9e145d70ce6d9e7a90d80bc
Fix CLI support for DVR, take 2

Previously --distributed was displayed as positional
argument in the help text, but acted as an optional
argument with the -- semantics. It now behaves like
any other optional argument.

A side-effect is that previously you could:
1) neutron router-create --distributed r1
2) neutron router-create --distributed=True r1
3) neutron router-create --distributed=False r1

While now only options 2 and 3 are viable.

DocImpact
Partially-implements: blueprint neutron-ovs-dvr
Closes-Bug: #1346121
Change-Id: I60675b4f60fe8154af4ab6d8f0e93867cf362a59
Small improve of str2dict function

Change-Id: Ifa8974f2cbdac4fdc0cbd47d7ad9910a5bd31cb7
Unify doc-strings format

Change-Id: If6cf2caeae294db30a8988ab861441211b651580
Remove unnecessary get_status_code wrapper function

Function get_status_code is used to get HTTP status code from
either requests.Response (status_code) or Webob.Response
(status_int). The latter was removed in 2012 and not needed
anymore.

Change-Id: Iacd6bbb83ce0d8ec5b8ec73273bc7bf39c9ccc8d
Merge "Repeat add-tenant and remove-tenant option in cli"
Merge "Remove unnecessary get_status_code wrapper function"
Merge "Avoid modifying default function arguments"
Updated from global requirements

Change-Id: I0628d1071955a7f82efd1e1e054fa38ae1dff006
Clean-up shell run and run_subcommand methods

Remove else branch of try-catch block since
it is never executed.

Get rid of passing result to shell clean-up function
since it is not used.

Change-Id: I9360d1e27fc203672ba0511b58172f5c776bdfb6
Leverage openstack.common.jsonutils

This patch removes our own home brewed json helper functions and leverages
the ones from openstack.common.jsonutils instead.

Change-Id: Idc5ee0fec56b0a0f337433a830647d4f421a8283
Closes-bug: 1365263
Merge "Leverage openstack.common.jsonutils"
Merge "Small improve of str2dict function"
Isolate tests from HTTP_PROXY, OS_REGION_NAME env vars

CLI and shell tests call into a mock httpretty REST service.  If
HTTP_PROXY is set, urllib2/requests follows it and fails to hit the
mocked httpretty service as expected.

Also: The shell tests assumed OS_REGION_NAME was unset, so also clear
this.

Change-Id: I9a3f4981ee5c32203f9127e9eb8eefe5efd1b6dc
Closes-Bug: #1367102
Closes-Bug: #1367105
Improve help strings

Improve consistency of help strings: Add missing ".", fix wording.

Change-Id: If9dba459dcbbf695b9057e82525a83371ceebd8b
Add L3 HA / VRRP support to CLI

Change-Id: Ia1f758f5536780a3170d624d61a3b2fa66eff76e
Partially-implements: blueprint l3-high-availability