Remove unneded/unused/duplicate code

Change-Id: Icf76b582e659cb96247baf1958ec7c8c82363c62
Query improvements

Improve various queries all over:

- Prefer passing the Python class or property to Query.join() over
  string literals
- Use "aliased=True" where possible when we're building queries
  programmatically
- Prefer passing a single property over using the 2-argument version of
  Query.join()

Change-Id: Id8ef798d4b99b7abbd2acd31c785eb055d74c74b
Drop unused argument of remove_host()

Change-Id: I40a024150415bc1a04142ab3d6c02f814708e319
Tighten type checks in the locking code

Passing the wrong type of object may result in generating a different
key, wich would mean operations which should block would not.

Change-Id: Ia1de02b87b2dda4fe79d2f1aee275fe99647aa03
Small feature reorg

Use sets instead of lists, sort features in the raw output.

Change-Id: I52d6d4ad44338728fd225fa506634a7297bf82c1
Use the .archetype proxy property more

This way the conversion from personality to personality_version will
touch less code.

Change-Id: I11f50871a674349c2415af191018735caf5e181b
Fix formatter error generation

The result may not be a subclass of Base, so don't try to use our
formatting codes if the requested output format is not available.

Change-Id: I492b288310060b105d1e3b0f7b5717d45da467d9
Fix a bunch of pep8 and pylint issues

Change-Id: I0abf8ddb35509867962a96cb8117650f74aea42a
Misc. cleanups

Change-Id: I37cabc719693e16e65e25d610dafaf3fdba008f2
Add search_metacluster

And stop search_cluster and "show_cluster --all" from returning
metaclusters.

Addresses-Issue: Jira/AQUILON-1659
Change-Id: I8d33f9bf96da3ffaa80c1e427e06adbf4ddc67fa
Drop the --fullinfo option of show_chassis

None of the other show commands have this option.

Change-Id: I8c488538011053c461e56827af52698a27390abe
Add protobuf support to some "show ... --all" commands

Support minimal protobuf output for "show ... --all" commands that make
use of StringAttributeList. Currently, such commands include:
show_cluster, show_host, show_metacluster, show_virtual_switch,
show_machine.

Change-Id: I498e693af899e9a429699eb39df3130c70b7885b
Speed up "show_host --all" a bit

Do not load relations we won't use.

Change-Id: I40225961da887dc4f8fc13d8a61c0a49c9560361
Fix for "show_host --grns --format proto", part 1

The protobuf output generated by "show_host --grns" is not consistent
with the output without the --grns flag: the .hostname field should
contain the short name only, not the FQDN. Fixing it needs multiple
steps - this change causes the .fqdn field to be filled in, so
applications can be updated to use it instead of .hostname. When all
apps are updated, we can fix .hostname to be the short name only.

Change-Id: I7803af7e23eaf81c8d231d3f62340f961f2d0431
Drop SimplePersonalityList

Users of the protobuf formatter seem to be using --fullinfo anyway, so
there's no performance benefit of having a stripped down formatter.

Change-Id: Iad7cc5d977adbf3192ada41ef8f31bcad2bce931
Bump the version of protobuf

Change-Id: Ic4e8d3a113b483e21ed27b488aac1b257baf1425
Logging improvements

Adapting run_command() to be used in by the consistency checker caused
output being duplicated when run by the broker. Fix that by introducing
a separate stream_level option, which indicates if the caller wants the
output to be streamed to the logger while the command is still running.
As an optimization, fall back to p.communicate() if no streaming is
needed.

When streaming the output to the logger, use the Twisted logging context
from the caller to make sure all lines are prefixed with the request
identifier. Drop the duplicate logging of the output, as this is now
redundant.

Change-Id: I4d23c6ec215c1d15f3a2b73d7818f743f0d43379
Increase the verbosity of domain sync

When there are many tracking domains to update, it is nice to have some
indication of progress.

Change-Id: Ic9a1f7f5f2c653d246349c537eca7c0d89a40a29
Improve error from del_machine

Do not repeat the FQDN.

Change-Id: I028a843381d7a91f3f15a48bb17c5abec43905b8
Improve coverage report

Annotate code that cannot be reached, drop some unused code.

Change-Id: I8af4683b86936b03583457e294fd699e2e5c2e85