Use six.moves.urllib.parse instead of urlparse

To keep Python 3.x compatibility, use six.moves.urllib.parse to
replace urlparse.

Closes-Bug: #1279611
Change-Id: I1867ef3ab0fd13cc7fd0875b419e06c2d96963c2
Remove unused variables

o trove/backup/models.py:SWIFT_CONTAINER = CONF.backup_swift_container

  This variable was added in the following commit.

    commit ce208d6cabba227576f492e7647d9da5a89e7c25
    Author: ruiyuan-shen <ruiyuan.shen@hp.com>
    Date:   Mon Mar 18 14:07:37 2013 -0700

        Add snapshot ORM to reddwarf

  But there is no evidence that was used.

o trove/dns/rsdns/driver.py:DNS_HOSTNAME = CONF.dns_hostname

  This variable was added in the following commit.

    commit 0c34c75dc44876245709987a18ea004607fca815
    Author: Sudarshan Acharya <sudarshan.acharya@rackspace.com>
    Date:   Fri May 18 15:49:12 2012 -0500

        DNS Support for Instance IP.

  But there is no evidence that was used.

o trove/instance/models.py:SERVER_INVALID_ACTION_STATUSES
   = ["BUILD", "REBOOT", "REBUILD", "RESIZE"]

  This variable was removed in the following commit.

    commit 54a4ada785fd90af5134e7f38360938e0b435696
    Author: Ed Cranford <ed.cranford@rackspace.com>
    Date:   Thu Jul 12 15:01:01 2012 -0500

        Delete can now delete errored instances.

o trove/instance/models.py:VALID_ACTION_STATUSES = ["ACTIVE"]

  This variable was removed in the following commit.

    commit 9ccef6fea42454bb22c0d67bd4d2a0765f13d370
    Author: Tim Simpson <tim.simpson@rackspace.com>
    Date:   Wed Jun 27 11:12:28 2012 -0500

        Allowing resizes to be performed when MySQL is down.

Closes-Bug: #1286990
Change-Id: I79f5bb124f2702317d8d337c969c9ff8ea69a769
Removes XML api from trove

The XML api is no longer a requirement, as dictated by the TC.

implements blueprint destroy-xml-api

Change-Id: Ib4669155c19562ae1dda75cd30ad1a8f92b6be6a
Test restore full and restore incremental

Closes-Bug: #1280487
Change-Id: I29ce959d595a604b2df1adf7beec6ade5030105e
Fixes insecure update of /etc/fstab file

Reasons:
- While updating /etc/fstab in write_to_fstab in
  trove/guestagent/volume.py, the temporary file-name was easy to
  guess and had a permanent name making it prone to unwanted access.
- The temporary file-permission was set to 666, making it insecure.

Changes:
- Uses NamedTemporaryFile for temporary file creation.
- Used file reading instead of copying the file.
- These changes eliminate the chances of guessing the file-name,
  as well as updating the same.

Change-Id: I07c3980e40fe218d35605a851a17535cd3972c11
Closes-Bug: #1267991
Make hostnames in designate driver all lower case

Currently hostnames are uppercase, this enforces lower case which
is the norm when specifying hostnames.

Closes-bug: 1291189
Change-Id: Ief92bc1aeffddd5dee99cd19d703c8a75bc50845
Removes volumes redefinition in fake nova_client

Reasons:
- The redefinition of nova_client.volumes was making it,
  nova_client.volumes.volumes, if we needed to call the volume APIs
  from nova_client.
- nova_client.volumes is already defined when defining "class FakeClient".

Changes:
- Removes redefinition of nova_client.volumes.

Change-Id: I5981d461e5a0fd000214c35d5d0be58d86d6d368
Closes-Bug: #1292457
Hide Datastores In List With No Active Versions

in a datastore-list operation, for non-admin, filters out
datastores that either have no versions or have no active
versions for non-admin users. admins continue to see all
datastores, active or inactive, in a datastore-list
operation.

Change-Id: Iccaf9ae59469fd0f4cb346ee258d3132eed83660
Co-Authored-By: Andrey Shestakov <ashestakov@mirantis.com>
Closes-Bug: #1290617
Improve Datastore Not Implemented exceptions

Added exception for not implemented exceptions
that indicates the operation name.
Added missing un-implemented methods to redis.
Change handling of remote errors from guest agent
api to only pass along the root exception message
rather than the full traceback

Change-Id: I0d4fdc5340bfb40370595636cc57cc5c87889507
Closes-Bug: #1276860
Fix Timestamp diff in Instance and Notification

    Code is updating timestamp to clear out task status after it
    has already completed the task and updated the instance db
    info.  Made this an single transaction so that the timestamp
    in the db matches the actual action and the notification

Closes-Bug: 1236620

Change-Id: Iaa59f6e6d0b958e79b0491bfa2a838f5896d9705
Merge "Make hostnames in designate driver all lower case"
Merge "Improve Datastore Not Implemented exceptions"
Merge "Removes XML api from trove"
Merge "Fix Timestamp diff in Instance and Notification"
Merge "Hide Datastores In List With No Active Versions"
fix default rabbitmq configuration values in sample cfgs

The rabbit_* configuration options have default values in the library
code, but they are not visible in the sample configuration file. This
change adds the config values to the sample configuration files.

It also removes the other unused notifier_* config attributes.

Change-Id: I4ae76ef78b7a0a04c2ea5a24fd3000e9c1561f81
Closes-Bug: #1281975
Remove IDENTIFIED BY clause for MySQL REVOKE

IDENTIFIED BY is not documented for REVOKE in MySQL 5.5 and 5.6 and
furthermore produces a syntax error on MySQL 5.6.

Change-Id: Ib7bf1ba0ce049c1ed8a90292064a1e05724170e0
Closes-Bug: #1292690
Update sqlalchemy migrate scripts for postgres

pgsql <= 8.3 was lax about char->other casting but this was tightened
up in 8.4+. We must now specify the USING clause for such a cast to
succeed. The SQL queries generated by sqlalchemy for pgsql don't
support this, so an override is needed to support pgsql for the trove
migrate scripts.

Closes-bug: 1293465
Change-Id: I217fc861036911e61bafe706e338bb3b8f49e708
Added Backup/Restore validations

Added checks for backup-create API call to ensure
datastore supports backup strategy
Also for trove-create API call (when restoring from backup)
added checks to ensure that datastore version of backup
being restored matches with datastore version of
instance being created

Change-Id: I9f9cf76ce3d2533612515e6382a184e955e09a32
Closes-Bug: #1285876
Fixed unit test to not actually run backup command

One unit tests is still trying to execute the actual backup command
instead of the mocked backup command. This is causing an issue on
the Jenkins slave where it is trying to run as sudo (and failing).
Fixed the test to use a mock runner, and not try to run innobackupex.

Change-Id: Ifff7945be158a08167cdd282ed8eb18952224eee
Closes-bug: 1291516