VMware: remove unused variable

The flag was never used since it was added in commit
24d609447399e468937f8a278854690864ffabcd

Change-Id: Ia034ccff1220783c2dd8c37c76fce24063f12682
Rename NotAuthorized exception to Forbidden

The NotAuthorized NovaException has an internal code of 403 which is
actually Forbidden, so rename it appropriately.

This patch doesn't change the external behavior, the status code in
responses will still be 403 but the exception is just named properly.

This is also necessary to create an actual Unauthorized NovaException
with code 401 for use in some Neutron API bug fixes for more granular
error handling from python-neutronclient.

Related-Bug: #1298075

Change-Id: I691fac2e2c797f47c04da7965d7b1c8685c74edb
Verify created/updated timestamps are isotime

We format these timestamps using timeutils.isotime() in the server
view builder, so we should check that in the API sample tests rather
than using the generic timestamp regexp.

Full context here:

  http://lists.openstack.org/pipermail/openstack-dev/2014-April/033971.html

Change-Id: Id55f13d8163249275220151dd88c67b47e6176c9
Verify next-available limit timestamps are isotime

We format these timestamps using timeutils.isotime() in the limits
view builder, so we should check that in the API sample tests rather
than using the generic timestamp regexp.

Full context here:

  http://lists.openstack.org/pipermail/openstack-dev/2014-April/033971.html

Change-Id: I14bf2eccec38f271eec8d97e8dca6d46f9d93cb3
Verify created_at cloudpipe timestamp is isotime

We format these timestamps using timeutils.isotime() in the cloudpipe
API extension, so we should check that in the API sample tests rather
than using the generic timestamp regexp.

Full context here:

  http://lists.openstack.org/pipermail/openstack-dev/2014-April/033971.html

Change-Id: I52543f68a512da4064a905e2efa453425ce36dae
Use datetime object for stub created_at timestamp

The stubbed out volumes methods returns a volume object with a
pre-serialized datetime object which doesn't give us the opportunity
to test the serialization code properly. Use a real object instead.

Full context here:

  http://lists.openstack.org/pipermail/openstack-dev/2014-April/033971.html

Change-Id: Ie54a3deaf1c32f3e57d03737e9ea1e9dd66a98d8
Use datetime object for fake network timestamps

The fake networks use a pre-serialized timestamp in str(datetime)
format which which doesn't give us the opportunity to test the
serialization code properly and isn't the format use in practice.

Use real dateime objects instead.

Full context here:

  http://lists.openstack.org/pipermail/openstack-dev/2014-April/033971.html

Change-Id: I5cbe722fb59cdd326b4c75dcfea14f206d71f668
wrap_check_security_groups_policy is already defined

Removes the local method 'wrap_check_security_groups_policy' to
the module neutron_driver.py - This method is already defined
in compute_api.

Change-Id: I008326f7b77515a0fc878befe45fe705420835ad
Closes-Bug: #1314548
Fix bad Mock calls to assert_called_once()

To actually check if a call was made, we should use
assert_called_once_with. assert_called_once is just a auto-spec'd
method and hence does not really check anything.

Change-Id: I21064dfca2a281683ee3b6ed4926f471bb74dbfa
Merge "Rename NotAuthorized exception to Forbidden"
Merge "Verify created/updated timestamps are isotime"
Merge "Verify next-available limit timestamps are isotime"
Merge "Verify created_at cloudpipe timestamp is isotime"
Merge "Use datetime object for stub created_at timestamp"
Merge "Use datetime object for fake network timestamps"
Merge "Fix bad Mock calls to assert_called_once()"
xenapi: fixup agent tests

The root cause of the slow agent tests was not mocking this method:
compute_utils.add_instance_fault_from_exc

This cleans up the tests to share a bit more code, and ensures they
actually check that the appropriate exception is raised.

This change adds a log message to report errors that could occur in
running systems that also helped identify this issue in the unit tests.

test_spawn_fails_agent_not_implemented was a duplicate test and has been
removed.

Change-Id: I6fd31520fffd5e888ce0c2b58af2715f0d929ce1
Closes-Bug: #1279317
Merge "VMware: remove unused variable"
Merge "xenapi: fixup agent tests"
Merge "wrap_check_security_groups_policy is already defined"