devmode fixing path to force requirements

Signed-off-by: Gregory Meno <gmeno@redhat.com>
doc: typo connection/connecting

Signed-off-by: John Spray <john.spray@redhat.com>
calamari_rest: handle serverless service

This case can happen during removal of servers, where
any service using that server will be unhooked from it
by setting the service's server to None.

Signed-off-by: John Spray <john.spray@redhat.com>
Merge pull request #161 from ceph/wip-fqdn-none

calamari_rest: handle serverless service
Merge pull request #160 from tserong/wip-minor-tweaks

A few small tweaks

Reviewed-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: John Spray <john.spray@inktank.com>
conf/salt.master.conf: Add SUSE apache user

Signed-off-by: Tim Serong <tserong@suse.com>
calamari/manage.py: Set a+x file permissions

Want this to have the executable bit set so it can be run directly from
the shell if necessary, rather than prefixing with python.

Signed-off-by: Tim Serong <tserong@suse.com>
Makefile: Add build-unpacked target

This installs calamari-common, rest-api, calamari-web and cthulhu to the
global python site dir, instead of having them installed in the venv.

Signed-off-by: Tim Serong <tserong@suse.com>
Makefile: Add install-suse targets

This also adds SUSE versions of the apache and calamari config files.

Signed-off-by: Tim Serong <tserong@suse.com>
carbon.conf: Set PID_DIR=/var/run

Without this, when carbon cache is run from /usr/bin/carbon, it thinks
GRAPHITE_ROOT is /usr, and tries to create pidfiles by default under
/usr/storage

Signed-off-by: Tim Serong <tserong@suse.com>
postgres.sql: Add SUSE support

Salt uses `systemctl --all list-units` to check if services exist.
systemd will only list services that have been loaded.  For LSB init
scripts (of which postgresql is one), it seems systemd won't load these
unless they've been invoked at least once somehow.  So this commit
ensures that the postgresql init script is actually invoked
(`rcpostgresql status`) prior to any other fiddling with postgresql.
This is a horrible hack.

Signed-off-by: Tim Serong <tserong@suse.com>
Add systemd service files for carbon and cthulhu

For SUSE, provide systemd service files for carbon and cthulhu.  This
means there's no need for supervisord, and systemd can take care of
starting everything nicely in the correct order.

Signed-off-by: Tim Serong <tserong@suse.com>
calamari_ctl.py: Use `systemctl restart cthulhu` on SUSE

Signed-off-by: Tim Serong <tserong@suse.com>
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>
Add spec file for SUSE build

This spec file is suitable for building calamari-server on
build.opensuse.org without using vagrant, i.e. we rely on the build
service to ensure we have a sane, clean build environment.

Note that this approach requires all runtime dependencies to be packaged
as RPMs (see Requires list in spec file), and most everything is
installed globally (e.g.: python stuff in the site python directory),
with only a few thins remaining in /opt/calamari.  These remaining
/opt/calamari pieces should eventually be moved to /etc or /usr/share.

Signed-off-by: Tim Serong <tserong@suse.com>
Allow global (/usr/lib/...) graphite template dir

When graphite is installed from an RPM on SUSE Linux distros, graphite
root is /usr/share/graphite, but the graphite template directory is
under /usr/lib/python/..., so need to add the latter to TEMPLATE_DIRS
else the graphite dashboard isn't available.

Signed-off-by: Tim Serong <tserong@suse.com>
Expect python-carbon to provide carbon-cache systemd service

The calamari-carbon.service file really didn't belong to calamari - it
starts part of carbon, so it belongs in the python-carbon package.  On
SUSE, at least, this service expects carbon config to be in
/etc/carbon/carbon.conf, not /etc/graphite/carbon.conf, hence the change
to the SUSE spec file.  The Makefile still installs carbon.conf in
/etc/graphite/ as I'm not sure what other distros want to do.

This commit also relinquishes calamari-server's ownership of some
/var/lib/graphite directories that are owned by the graphite-web
package.

Signed-off-by: Tim Serong <tserong@suse.com>