Enclose command args in with_venv.sh

Change-Id: I6d2ca2f8fca951fe2d90265da8728438dd7d7567
Closes-Bug: #1220937
Move declaration of int_br_device_count earlier

_report_state is being called by setup_rpc so int_br_device_count needs
to be initialized earlier. To avoid
AttributeError: object has no attribute 'int_br_device_count'

This wasn't caught by unit tests for 3 separate reason
o The reference to self.int_br_device_count is wrapped in
  except Exception: log / pass
- This reference has been moved outside of the try/except

o Unit tests set report_interval to 0 so the heartbeat wasn't called
  during unit tests.
- now removed

o The function passed into FixedIntervalLoopingCall isn't started
  anyways so wasn't calling self._report_state
- replaced FixedIntervalLoopingCall with a mock that calls the
  function once.

Fixes bug #1221054

Change-Id: I572af4ee017c1f7f016c8f9981ca54d1301442d1
Hash device_id only if it is longer than the allowed MAX size for NVP

This ensure that a VM uuid stays untouched, avoiding potential
confusion when inspecting NVP port tags. This patch also abstracts
the hashing method out by introducing a device_id_to_vm_id method.
Filtering logic is preserved, and a test has been added to ensure
that. However such a logic is not currently used in the NeutronPlugin
(because of the introduction of async status updates), but it has
been added as utility method to nvplib.

Fixes bug #1215204

Change-Id: Ib96ecae438e30f195c8b45176abc1cf55b4b363f
Imported Translations from Transifex

Change-Id: I874308f83a54defeb77336acc1c0318172db1bb6
Replace assertEquals with assertEqual

The method assertEquals has been deprecated since python 2.7.
http://docs.python.org/2/library/unittest.html#deprecated-aliases

Also in Python 3, a deprecated warning is raised when using assertEquals
therefore we should use assertEqual instead.

Fixes bug #1221601

Change-Id: Id502cfbc210c6c3fe0a256d5350e159ffa220141
Fix incorrect NotImplementedError

neutron.common.exceptions doesn't define NotImplementedError, but
some codes still use it. We should use builtin
exceptions.NotImplementedError instead.

Note: this patch also fixes a never run code in nvp.

Closes-Bug: #1221500
Change-Id: I5f367ab5edc1e7fbbc2e4eba5fe36d148d4d062d
Mock midonetclient in test_midonet_lib

Change-Id: Idb4de82c193b2f2589131b06bad04bc858499a21
Closes-bug: #1221674
Load ML2 mech drivers as listed in ml2_conf.ini

stevedore requires an additional parameter to be used (name_order=True) to
sort the loaded extensions to match the order used in the parameter "names".

bug 1221490

Change-Id: I614716c45d91cdf152650fba5ec8ced1e9c5aad4
Merge "Replace assertEquals with assertEqual"
Make neutron.common.log.log print module path

Closes-Bug: #1221663

neutron.common.log.log is useful for logging arguments of a method.
It outputs class name and method name, but module path is not output.
A module path is useful to search the log message.

Change-Id: Ic2903da750cc13980d5cdee153bb079f7d4ee122
Prevents 400 NVP errors caused by a None display_name

The API forbids a resource name to be None, but the
Model does not. Such errors may  be induced by
programming directly against the plugin interface. With
this fix we avoid raising 400 faults which may be introduced
by involuntary programming errors.

Fixes bug 1221896

Change-Id: Ic1201c5af5691f2bed38753453f73c229858b10f
Fix IF checks on spawned green thread instance

Initially the symptom looks like race condition between two threads when
stopping the task manager. After further analysis/troubleshooting, it
turns out that two threads are spawned if a task manager is stopped and
started again, causing unexpected errors.

The IF check on the spawned thread sometimes return True sometime return False
if not compared against None explicitly. This makes start() method
think no thread has been started or stop() method think no thread is started.
Change the check to compare against None.

Also fixed a problem in unit-test where a thread may never terminated when
a stop call is invoked during db access.

Closes-Bug: 1221486
Change-Id: I0d67bfe8fef7a390f0d6bc0f5a42835f86a9fb27
Merge "Mock midonetclient in test_midonet_lib"
Imported Translations from Transifex

Change-Id: I4602704b4a4f1be5a49f1431eebd58072dfb7704
Merge "Fix IF checks on spawned green thread instance"
Merge "Imported Translations from Transifex"
Merge "Enclose command args in with_venv.sh"
Enhance unittest for hyperv_neutron_agent

Change-Id: Idc726ba668eba56a64dc498b49ec0e5e397590b5
Fix message i18n error

Partial-Bug: #1217100

Using tools/check_i18n.py to scan source directory, and fix most of
the errors.

- Message internationalization
- First letter must be capital
- Using comma instead of percent in LOG.xxx

Note: all extension's description are not touched in this patch,
can be fixed after discussing.
Note: all nicira/check_nvp_config.py print messages are not fixed.

Change-Id: I79ef06fd42f6780beb5019c592662536c2a51864
Imported Translations from Transifex

Change-Id: I3f069fcb0ff5645581152ca33d12ed802d0779e5