calamari_ctl.py: move get_user_model import to initialize function

Having 'from django.contrib.auth import get_user_model' at the top of
the file causes an exception with Django 1.6 on openSUSE, due to
DJANGO_SETTINGS_MODULE not being set yet.  Moving the import to the
initialize function fixes this (although it violates PEP-8).

Signed-off-by: Tim Serong <tserong@suse.com>
tests: Pick up rotated XSRF token after login

At some point, Django started rotating XSRF tokens after login.  If we
don't pick up the rotated token, the tests fail with a 403 error and the
message "CSRF verification failed. Request aborted."

Signed-off-by: Tim Serong <tserong@suse.com>
tests: don't try to accept existing minions

When running against an external calamari instance, successive tests
re-authorize existing minions, which fails with:

400: {"detail": {"status": ["Transition accepted->accepted is invalid"]}}

To avoid this, we're now checking if minions are already accepted first.

Signed-off-by: Tim Serong <tserong@suse.com>
tests: correctly catch stderr output when sshing to minions

Without stderr=PIPE, err doesn't get picked up by proc.communicate(), so
it's not logged; rather it's dumped to the console when running tests,
interfering with the normal output.

Signed-off-by: Tim Serong <tserong@suse.com>
tests: use sequence form of Popen constructor

This eliminates the need to quote the command passed to the remote host
thus making it easier to avoid shell escaping problems, and removes any
possible security risks of using shell=True.

Signed-off-by: Tim Serong <tserong@suse.com>
tests: ssh to minions as user specified in info.yaml

This removes the hard coded `ssh ubuntu@{target}`, which makes execution
on other distros problematic.

Signed-off-by: Tim Serong <tserong@suse.com>
Merge pull request #188 from SUSE/wip-fix-server-tests

tests: fix a few problems encountered running against external calamari instance
debian: Update build-depends to be able to use pbuilder

* Added debhelper and lsb-release to Build-Depends
* Bump Standards-Version to 3.9.3
* Added Vcs-Browser field
* Added readme to calamari-server docs
* Switch to architecture any (depends to python-dev)
* Added debhelper misc:Depends and python:Depends
dev-testing doc: Clarify master_fqdn and cluster_distro

Signed-off-by: Dan Mick <dan.mick@inktank.com>
calamari_rest: BOOTSTRAP_RHEL was missing sudo

Signed-off-by: Dan Mick <dan.mick@inktank.com>
calamari-web: "no i386 packages" warnings from apt-get during bootstrap

Fixes: #8662
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Merge pull request #190 from ceph/wip-8662

calamari-web: "no i386 packages" warnings from apt-get during bootstrap
Merge pull request #191 from ceph/wip-testing-nits

Wip testing nits
tests: cope better with `ceph pg stat` output

Most of the time, `ceph pg stat` gives output like:

"v211: 192 pgs: 192 active+clean; 16 bytes data, 232 MB used, 11154 GB /
11154 GB avail"

The current code splits on ':' and ';', and expects this to result in
four parts.  Occasionally though, `ceph pg stat` has some extra
information about recovery, which gives five parts:

"v136: 192 pgs: 192 active+clean; 16 bytes data, 239 MB used, 11154 GB /
11154 GB avail; 5 B/s, 0 objects/s recovering"

The way the splitting and assignment was implemented, the second output
would raise ValueError: too many values to unpack.  This change slices
the split to only grab total_stat and pg_stat, which is what we actually
care about.

Signed-off-by: Tim Serong <tserong@suse.com>
Missed a few 'ubuntu -> precise/trusty' changes

428ad273332a647b404a6c340c58880a72e0c898 added trusty builds, and
changed several 'ubuntu' names to either 'precise' or 'trusty';
there were several things connected with the local minion repo that
did not get fixed (the bootstrap script, the salt states for
making the repos, etc.)  This commit is the result of a scan for
'ubuntu' in any case and a replacement/fix for the missing bits.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Merge pull request #192 from SUSE/wip-fix-server-tests

tests: cope better with `ceph pg stat` output

Reviewed-by: Dan Mick <dan.mick@inktank.com>
Merge pull request #185 from SUSE/wip-django-1_6

calamari_ctl.py: move get_user_model import to initialize function
Merge pull request #189 from sbadia/fix-debian-build-deps

debian: Update build-depends to be able to use pbuilder
Merge pull request #193 from ceph/wip-9048

Missed a few 'ubuntu -> precise/trusty' changes