Fix profile cleanup

Handle JSON in addition to XML when profiles are about to be removed.

Change-Id: I1b174f71c25746b5263010b95c56228a8cb940b3
Reviewed-by: Priya Joshi <Priya.Joshi@morganstanley.com>
Avoid duplicating objects in the profile index

When moving objects between domains/sandboxes that have different
profile output format configured, currently the old format is not
cleaned up. Sidestep the cleanup issue by making sure the index shows
the most recent format only.

Change-Id: I1c77090c480840cf419f2c0700aac07564cf6254
Reviewed-by: Priya Joshi <Priya.Joshi@morganstanley.com>
Clean up old profiles if the extension changes

Change-Id: If396c5b36648def945a1082e81d1da04b1319b14
Reviewed-by: Priya Joshi <Priya.Joshi@morganstanley.com>
Allow selecting the profile format per domain/sandbox

This allows gradual transitioning from XML to JSON.

Change-Id: I53a6b092324f0604d87063313387d2e2bac25a6e
Reviewed-by: Priya Joshi <Priya.Joshi@morganstanley.com>
Python 3 compatibility: print() as a function

The code transformations were done by 2to3.

Change-Id: I3c9274bbe3192b7ea50fdedcdb321bcc8dfb6906
Reviewed-by: Dave Reeve <Dave.Reeve@morganstanley.com>
Python 3 compatibility: except syntax

Use the "as" keyword instead of a comma for the exception variable.

Change-Id: I5ba6a756bd7309d927625e7f41d28d20f159efee
Reviewed-by: Dave Reeve <Dave.Reeve@morganstanley.com>
Python 3 compatibility: kill apply()

Change-Id: I3a65311169b081988f850301566a435603e51b51
Reviewed-by: Dave Reeve <Dave.Reeve@morganstanley.com>
Python 3 compatibility: get rid if .has_key()

Change-Id: Iaf50e7b801801ee915cad85267e0f12df05f120e
Reviewed-by: Dave Reeve <Dave.Reeve@morganstanley.com>
Python 3 compatibility: octal literals

Change-Id: Iea41b0ab88a4c663844729d5f8dfa87b836e9fd1
Reviewed-by: Dave Reeve <Dave.Reeve@morganstanley.com>
Python 3 compatibility: use maxsize instead of maxint

We just need a constant that is larger than the maximum depth of the
location hierarchy, and maxsize is fine for that.

Change-Id: Ic811226f3c908d4067cadab0eade5de77cfedb43
Reviewed-by: Dave Reeve <Dave.Reeve@morganstanley.com>
Various cleanups

Random cleanups that were found while playing with 2to3.

Change-Id: I24865cc86addb39674330238d78af97d68fe2b10
Reviewed-by: Dave Reeve <Dave.Reeve@morganstanley.com>
Import functions selectively

In Python 3, some modules like urllib and httplib were split, others
like cStringIO got renamed. Importing individual functions instead of
whole modules means we'll need fewer changes when switching to Python 3.

Change-Id: Icf263d739323800c2d8d49db5c9d1037341bd98d
Reviewed-by: Dave Reeve <Dave.Reeve@morganstanley.com>
Sorting cleanups

Eliminate unneeded temporary variables. Make use of sorted() taking an
iterator like a list comprehension directly. Don't use cmp.

Change-Id: I65919c737e7af65af3c111b3e826fb2d7ba04e2a
Reviewed-by: Dave Reeve <Dave.Reeve@morganstanley.com>
Python 3 compatibility: don't use file()

Use open() instead.

Change-Id: I433050316ca449cdcc438fe347e8a40dcf666694
Reviewed-by: Dave Reeve <Dave.Reeve@morganstanley.com>
Python 3 compatibility: get rid of xreadlines

The file object is an iterator itself.

Change-Id: I2a3381a8972ea1bda11ece2d5b62faf5805ca8ab
Reviewed-by: Dave Reeve <Dave.Reeve@morganstanley.com>
Allow Secadmins to recompile after granting root access.

Addresses-Issue: Jira/AQUILON-1981
Change-Id: I1f14b5d2390ed445226b37f1d204e759144f76c8
Reviewed-By: Nathan Dimmock <Nathan.Dimmock@morganstanley.com>
Merge remote-tracking branch 'origin/for_next/profile_ext'
Merge remote-tracking branch 'origin/for_next/allow_compiles_for_secadmin'
Upgrade copyright license.
Testsuite: Standardize user/realm access

Move the parsing of klist output to brokertest.py, and use the
self.user/self.realm accessors everywhere.

Change-Id: Idec3edcea30ddfb6a56f7d72a6c16914dc9e6f1a
Reviewed-by: Dave Reeve <Dave.Reeve@morganstanley.com>