From 7b6e84db9e8f678bc7d23fd1a0a59722e242d04d Mon Sep 17 00:00:00 2001 From: Michael Elkins Date: Tue, 26 Mar 2013 23:28:31 +0000 Subject: convert the two remaining scripts using $top/buildtools/make-django-script.py to using rpki.gui.script_util.setup() instead so we can get rid of the build script svn path=/trunk/; revision=5233 --- rpkid/portal-gui/scripts/rpkigui-sync-users.py | 30 +++++++++++++++----------- 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'rpkid/portal-gui/scripts/rpkigui-sync-users.py') diff --git a/rpkid/portal-gui/scripts/rpkigui-sync-users.py b/rpkid/portal-gui/scripts/rpkigui-sync-users.py index 0f15c65d..9c636e95 100644 --- a/rpkid/portal-gui/scripts/rpkigui-sync-users.py +++ b/rpkid/portal-gui/scripts/rpkigui-sync-users.py @@ -1,18 +1,24 @@ +# Copyright (C) 2013 SPARTA, Inc. a Parsons Company +# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND SPARTA DISCLAIMS ALL WARRANTIES WITH +# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +# AND FITNESS. IN NO EVENT SHALL SPARTA BE LIABLE FOR ANY SPECIAL, DIRECT, +# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +# PERFORMANCE OF THIS SOFTWARE. + +__version__ = '$Id$' + """ Ensure that a web login exists for labuser* resource holder """ - -import os -import sys - -# if the environment is not already set up, look in the default places -if not os.getenv("DJANGO_SETTINGS_MODULE"): - os.environ["DJANGO_SETTINGS_MODULE"] = 'settings' - for d in ('/etc/rpki', '/usr/local/etc/rpki'): - if os.path.exists(os.path.join(d, 'settings.py')): - print 'found settings.py in ' + d - sys.path.insert(1, d) - break +from rpki.gui.script_util import setup +setup() from django.contrib.auth.models import User from rpki.gui.app.models import Conf, ConfACL -- cgit v1.2.3