Allow Host objects to be bound to HardwareEntity

Change-Id: I0b27476d205bab4cb59c5e033a1ae97bc7ed7ec2
Reviewed-by: Gabor Gombas <Gabor.Gombas@morganstanley.com>
Renamed 'switch' to 'network_device'

This change renames the switch table to network_device.  References to
switch_id in esx_cluster, observed_mac and observed_vlan where also
updated.  The user interface still refered to 'switch' for the time being.

Change-Id: Iddc7d7897da0833088d73ebd8c1b9b7c7bc35d1e
Reviewed-by: Gabor Gombas <Gabor.Gombas@morganstanley.com>
Rename model.machine_type column to model.model_type

Change-Id: I99420b34138eed1653dc4154e95e7164bf3d1870
Reviewed-by: Gabor Gombas <Gabor.Gombas@morganstanley.com>
Changing model type to be a true Enum

This change creates a StringEnum class, which automatically constructs a
fixed number of instances representing the enumerations.  The constructed
class provides simple test functions to simplify the code.

In addition a StringEnumColumn type decorator has been added that will
marshel a StringEnum to and from the underlying database.

Finally the input type handing system has been updated to marshel the
supplied string constants into StringEnum instanaces inside the code.

Change-Id: I66a98d094cf22c35269c17264a8d2cf50f08f5d7
Reviewed-by: Gabor Gombas <Gabor.Gombas@morganstanley.com>
Machines specs are for machines

Modified the add and update model code to only add machine_specs
to models that are a machine.

Change-Id: I447247296247a5f6b2ecbe256b6b5a8c083766cb
Reviewed-by: Gabor Gombas <Gabor.Gombas@morganstanley.com>
Fix short help messages

The help messages for mac and IP address were not displayed correctly.
Every option other than flags and booleans take an argument.

Change-Id: I427b8572dfd5cf7ac0f251dd3bece151d3ac6682
Reviewed-by: Gabor Gombas <Gabor.Gombas@morganstanley.com>
Adding network device types to model devices

Addresses-Issue: Jira/AQUILON-1371
Change-Id: I2fdf6b993491368f6b0b2456ad9f93e7136ab26f
Reviewed-by: Gabor Gombas <Gabor.Gombas@morganstanley.com>
Clean up add_organization

Change-Id: I0d8f14dcd30388051bf3f5e7edb2210d3fc2555c
Reviewed-by: Priya Joshi <Priya.Joshi@morganstanley.com>
Use the of_type() selector instead of hardcoded strings

Change-Id: I654ea27c8fefc4da86dcd5e445b40a3aa2f80a8e
Reviewed-by: Priya Joshi <Priya.Joshi@morganstanley.com>
Remove unneeded uselist annotations

"uselist=..." should only be used if the relation is one-to-one, or if
the join condition is complex and SQLAlchemy cannot figure out the
target.

Change-Id: I6c8874b6805382720eecc0e2556987bc5e8c9be9
Reviewed-by: Priya Joshi <Priya.Joshi@morganstanley.com>
Relax eager loading on the backref when subqueryload() is used

If A.b is a relation to B that is eager-loaded by default, then using
subqueryload() from the other direction (i.e.,
session.query(B).options(subqueryload(B.a))) will cause B to be loaded
twice. To avoid this, we need to explicitly cancel the eager-loading by
using lazyload().

Eventually, we should get rid of doing eager-loading directly in the
model because it's hard to get such policy right there, but that is a
bigger change.

Change-Id: I75609e110d12aa0b46dc3a8a54ad8181f95dea64
Reviewed-by: Zoltan Sebestyen <Zoltan.Sebestyen@morganstanley.com>
Load all resource holder subclasses

Loading a couple extra columns is cheaper than issuing extra queries.

Change-Id: I13511dfb7266ca0e8af24eff8279d686ade2f3c4
Reviewed-by: Zoltan Sebestyen <Zoltan.Sebestyen@morganstanley.com>
Optimize queries for big domain compiles

Load personality parameters using bulk queries.

Change-Id: Iea45de220318b6a3c49a847bc3f99ed4884c8427
Reviewed-by: Zoltan Sebestyen <Zoltan.Sebestyen@morganstanley.com>
Merge remote-tracking branch 'origin/for_next/networking'

Conflicts:
	lib/aquilon/worker/commands/add_interface_machine.py
	lib/aquilon/worker/commands/add_machine.py
	lib/aquilon/worker/commands/add_model.py
	lib/aquilon/worker/commands/search_observed_mac.py
	lib/aquilon/worker/commands/show_bunker_violations.py
	lib/aquilon/worker/commands/show_chassis_missing.py
	lib/aquilon/worker/commands/update_machine.py
	lib/aquilon/worker/dbwrappers/interface.py
	lib/aquilon/worker/formats/host.py
	tests/broker/test_add_aurora_host.py

Change-Id: Ic28624b89f712712620728ab87fb8545f7e47e3b
Merge remote-tracking branch 'origin/for_next/misc_changes'

Conflicts:
	lib/aquilon/worker/commands/flush.py

Change-Id: Ib4642b6fbce923b1d446d78008c822715a1752f0
Fix merge fallout

Change-Id: Ic6ae7b6b45e0c034ac9df5ffa1262c90f065d4ad
Fix pep8/pylint issues

Change-Id: I518f31ffe757f7e4b87805f7f07d44ebc16cfc30
Testsuite fix

The vulcan2-10g-test personality is gone, we need another one. The
hacluster schema no longer allows maint_threshold to be defined. There's
also more assumptions in templates about the naming of VXFS devices.

Change-Id: I2438b1707181cd6689c367153887815760f85353
Add PostgreSQL upgrade scripts

Change-Id: Iee7aa90a36447029ec4d19f27bcfc2d0046e4e44
Fix the DB migration script

Call configure_mappers() explicitely, to make sure __declare_last__() is
executed before trying to create any tables.

Change-Id: Ifa842c5fa60b4a0f2010116202468ec2f66feb57