Allow managing the trust of Kerberos realms

Sandboxes are owned by local Unix users, so we have to control which
Kerberos realms represent those Unix accounts. This commit introduces a
flag to tell if a Kerberos realm is trusted in the sense that all
principals have a local Unix account with the same name.

Change-Id: Ibd342809066d734b103785f45b880773268a44e0
Reviewed-by: Dave Reeve <Dave.Reeve@morganstanley.com>
Principal related changes

Update the model and the formatter to be more in line with the rest of
the code. Simplify principal creation. Do not load comments unless
really needed.

Change-Id: Ic0196725a44740807797f5e98f20f9a81bcb8932
Reviewed-by: Dave Reeve <Dave.Reeve@morganstanley.com>
Revert "Fix DSDB comment propergation"

This reverts commit efae11f9eca76e7cf1083b57003f92994b2ab6f4.

Change-Id: I08154d40ef28c6b9af874c717574e5b62eba6085
Addresses-Issue: Jira/AQUILON-1382
Enforce consistent variable nameing and comments for DSDB runner.

Change-Id: Ic2d3da2efc6ab64d86d3d500ae3ce211ea6bd318
Refactoring snapshot_hw and update_host

Change-Id: I319db5ad0d5b368ce9b9bdc258161cb7c83cfaa3
Refactor DSDB update internal calls

Change-Id: I69630a50213be6957cd3a58438bb73f78b1b60e1
Prevent Created automatically comment propergation to DSDB

Change-Id: I7ad9a1ead907dc9766592ad52036417ee5fd8d42
Change -primary_host_name to -new_host_name for DSDB updates

Name updates for DSDB pass -primary_host_name in order to update
the -new_host_name; not exactly clear.  This changes this to
be more obvious.

Change-Id: I78b72a6f38b45a34cfc210778b5f3312dad76732
Reviewed-by: Gabor Gombas <Gabor.Gombas@morganstanley.com>
Don't map_to_primary network devices

The default behaviour of mapping the PTR record for auxilary
address to the primary name does not make sense for network
devices.

Change-Id: I7deb4621f7f915bf2e50190067fd60ad6033fd58
Reviewed-by: Gabor Gombas <Gabor.Gombas@morganstanley.com>
Refactoring KNCHTTPChannel and adding some error handeling

Change-Id: I2b34337880ffce6536a4791df3739a79126c175b
Reviewed-by: Gabor Gombas <Gabor.Gombas@morganstanley.com>
Relocate getPrincipal and getClientIP into request

This changes uses server.Site.requestFactory to create Aquilon specific
request objects.  In the case of KNC we use these to store the addtional
KNC information.  The getPrincipal method is then moved into the request
object.

Change-Id: I359c191581034e88110cd0b978ee65e671267c46
Reviewed-by: Gabor Gombas <Gabor.Gombas@morganstanley.com>
Gathering twisted related modules together

The names anonwrappers and kncwrappers are not descirptive, they
do not indicate they they are related to twisted.  In addition
the term 'wrapper' indicates a work-around, rather than a
protocol implmentation as is the case here.

Change-Id: I2ac6d630b77139071ec07c03c9e2af082c84d14b
Reviewed-by: Gabor Gombas <Gabor.Gombas@morganstanley.com>
Refactoring twisted classes to use a common base

Change-Id: Ie7a3c050b4bd5f1543ca09d9804638131c174a40
Reviewed-by: Gabor Gombas <Gabor.Gombas@morganstanley.com>
Refactoring option type checking

This commit introduces a dict containing the type checkers, this
is used to replace the large if/else clause.

Change-Id: Iff7fe8bce6eb22e65d420d9d7988ee9ed6b14cd9
Reviewed-by: Gabor Gombas <Gabor.Gombas@morganstanley.com>
Restore interface name/mac on DSDB rollback

If the DSDB deletion of a network device or chassic failes then
the interface and mac address information will be lost.  This
change modifies the behaviour of DSDBRunner.update_host to
handle deletion (by passing only the old information).  The
snaphot created with DSDBRunner.snapshot_hw contains all of the
information needd to rollback; removing the need to local variables
to contain the same information.

Change-Id: I36479ce4069a463735fb2ea5b413610605bef499
Reviewed-by: Gabor Gombas <Gabor.Gombas@morganstanley.com>
Move "only has a primary IP" check to a dbwrapper

All hardware devices check that the only address assignement is
that of the primary IP before deletion.  This commit moves the
common logic into it own dbwapper.

Change-Id: I096f6613de38b00d1998153477f78e306ec79075
Reviewed-by: Gabor Gombas <Gabor.Gombas@morganstanley.com>
Merge remote-tracking branch 'origin/for_next/dsdb_name_updates'

Conflicts:
	lib/aquilon/worker/processes.py

Change-Id: I6b937b234c6a6d66bdd15148f1b855f25ba42139
Merge remote-tracking branch 'origin/for_next/check_pri_ip'
Merge remote-tracking branch 'origin/for_next/del_dsdb_rollback'
Merge remote-tracking branch 'origin/for_next/netdev_ptr_rec'