diff options
author | Michael Elkins <melkins@tislabs.com> | 2013-03-26 23:28:31 +0000 |
---|---|---|
committer | Michael Elkins <melkins@tislabs.com> | 2013-03-26 23:28:31 +0000 |
commit | 7b6e84db9e8f678bc7d23fd1a0a59722e242d04d (patch) | |
tree | 67f85e1c0c55014db7ff368b32d0a1ff94939c0b /rpkid/portal-gui | |
parent | e5457ccce615c8aeb31aa6e9e7dddd2d11282958 (diff) |
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
Diffstat (limited to 'rpkid/portal-gui')
-rw-r--r-- | rpkid/portal-gui/scripts/rpkigui-reset-demo.py | 7 | ||||
-rw-r--r-- | rpkid/portal-gui/scripts/rpkigui-sync-users.py | 30 |
2 files changed, 24 insertions, 13 deletions
diff --git a/rpkid/portal-gui/scripts/rpkigui-reset-demo.py b/rpkid/portal-gui/scripts/rpkigui-reset-demo.py index acfddabd..ddb9fcef 100644 --- a/rpkid/portal-gui/scripts/rpkigui-reset-demo.py +++ b/rpkid/portal-gui/scripts/rpkigui-reset-demo.py @@ -1,4 +1,4 @@ -# Copyright (C) 2012 SPARTA, Inc. a Parsons Company +# Copyright (C) 2012, 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 @@ -21,6 +21,11 @@ issued by the labuser accounts. __version__ = '$Id$' +from rpki.gui.script_util import setup +setup() + +import sys + from rpki.irdb.models import ROARequest, GhostbusterRequest, ResourceHolderCA from rpki.gui.app.glue import list_received_resources 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 |