allow both ipv4 and ipv6 hostnames by default

Refactored the code to use netaddr rather than re-implementing IP
address validation. This gives us IPv6 support for free.

DocImpact
The hostname_require_ipv4 configuration option is being
removed in favor of hostname_require_valid_ip. The latter is more
inclusive and validates both IPv4 and IPv6 addresses.

Change-Id: I36c76169f2ab3bb7f54f67db522309a49ae61f7a
Closes-Bug: #1343192
Use netifaces to lookup IP address on guest agent

The current way of looking up the IP address on the guest
doesn't correctly work across all platforms. Use netifaces
instead which works correctly across all platforms.

Change-Id: I3d5febb1dd801fdf7801613cd843e7c00f308016
In some cases, guest agents may leave temporary config files

The code in these three places manipulates the configuration files. I
was (admittedly) having more than the acceptable dose of failures in
execute_with_timeout() and one of them that failed was the move of the
my.cnf file. And this left a turd in /tmp. The failures I was having
with execute_with_timeout relate to other tests that were improperly
mocking/unmocking and some of those problems have now been fixed.

Found that the same kind of thing can happen in cassandra and
mongo. Since default umask is 664, this leaves a file with somewhat
questionable permissions and potentially (at least for MySQL) some
passwords in /tmp.

The files will now be deleted.

Some test cases have been added to exercise the code paths(s) in
mongo, cassandra and mysql. The tests verify that the files are
actually deleted by mocking the os.unlink call. setUp and tearDown
have been updated in each case to make sure that the monkey patching
is properly reversed.

Change-Id: I93302fc5b1b18c9dd7116370a945b94d1824c75a
Closes-Bug: #1354136
Datastore Configuration Parameters stored in db

Changes:
Add datastore configuration paramters to configuration model
Add ability to CRUD configuration parameters
adding a manage cmd to import the config params

partially implements blueprint configuration-parameters-in-db
Change-Id: I51d5281ba8922dc19c74e7c6e972f40e45416d50
Merge "Datastore Configuration Parameters stored in db"
Merge "allow both ipv4 and ipv6 hostnames by default"
Merge "Use netifaces to lookup IP address on guest agent"
Updated from global requirements

Change-Id: I1b5469ec546694a4f8f48b9500a733c36d316509
Fix issue with intermittent test failures in test_pkg.py

The test failures were a result of randomized test order and the way
in which these tests were setting up mocks for pexpect.spawn.expect
and pexpect.spawn.match.

The code now mocks pexpect.spawn and then sets return values and match
in each test as appropriate. Code in setUp establishes a patch and a
cleanUp function is added to reverse the patch. No code is required in
tearDown as a result.

execute() was being Mocked using code in setUp and tearDown and this
was replaced that with a similar patch in setUp with a corresponding
cleanUp function to reverse its effects.

Since we're close to Juno, I've not gone down the path of converting
this test to use a fixture which would further reduce duplicated code.

Change-Id: I3edfd499823f2c2f4591e709384a24f1b55abe5a
Closes-Bug: 1365531
Marks mysql slave read-only

When a slave is attached to a master site, this change will
mark the slave site as read-only to prevent the slave site
from being updated by users.  Only users with root privileges
or slave priveleges will be able to update the database.

Change-Id: Idb6c54b85a23af9a468ff9d62b3110fa72ff7da0
Closes-bug: #1359392
Register postgres_group in trove config

Change-Id: I9e2c4c166550fbfe77c394e0b5220220d07469df
Closes-Bug: #1367467
Merge "Marks mysql slave read-only"
Merge "Fix issue with intermittent test failures in test_pkg.py"
Strengthens the regex for mongodb json functions

Encloses function args in quotes. abc: Foo(foo, bar)
changes to abc : "foo, bar". Intent is to prevent
mongodb json peculiarities from preventing parsing
of the json

Change-Id: Iafd81cf74908078155344ef4746632d48c460f6a
Closes-Bug: #1368373
Fix NoSuchOptError on Couchbase create

A previous commit moved the backup_incremental_strategy option from
DEFAULT group to datastore specific grouping. However, the option was
only implemented for Mysql and Percona so when any datastore that had
backup support (like Couchbase) attempted to start, it received a
NoSuchOptError because of the missing option.

This fix put an empty dict in for the option for all datastores that
don't currently have backup or incremental backup support implemented.

Note: this wasn't picked up by any automated tests because the gate
currently only tests MySQL.

Author: Doug Shelley <doug@parelastic.com>
Co-Authored-By: Amrith Kumar <amrith@tesora.com>
Change-Id: I6a11dcf79c483a43ebdf79085d1bd17d653afe59
Closes-Bug: 1366175
Imported Translations from Transifex

Change-Id: I020032ab9a35b0dedfb0875cb717aa89d7abca84
Make --repo-path an optional argument for db_recreate

db_recreate uses repo-path to call db_sync, but for db_sync this
argument is optional so it should be optional for db_recreate as
well.

Closes-Bug: #1279734

Change-Id: I68b0eb3c705525a047eb6bffe8d5e1b4b083cd91
Merge "Fix NoSuchOptError on Couchbase create"
Delete backup created during replication

During replication, backup of the master instance is
taken, and a slave is created using this backup.
This patch cleans up the backup which is created
during this process (irrespective of whether it was
successfully provisioned or not).

Closes-Bug: #1359354
Change-Id: Ic636ffeb0bbfb9e6cc02690efe812ffc11bda85c
Fix config parameters test for fake mode

This commit makes the config parameters tests run in fake mode.

Closes-Bug: 1370237
Change-Id: I6ce228a627b35ee418c290a9f19baa163261fb7c