diff options
Diffstat (limited to 'portal-gui/scripts')
-rw-r--r--[-rwxr-xr-x] | portal-gui/scripts/adduser.py | 12 | ||||
-rwxr-xr-x | portal-gui/scripts/helper.in | 27 | ||||
-rw-r--r--[-rwxr-xr-x] | portal-gui/scripts/list_resources.py | 6 | ||||
-rwxr-xr-x | portal-gui/scripts/load_csv.py | 7 |
4 files changed, 19 insertions, 33 deletions
diff --git a/portal-gui/scripts/adduser.py b/portal-gui/scripts/adduser.py index 27e73ed7..109e360f 100755..100644 --- a/portal-gui/scripts/adduser.py +++ b/portal-gui/scripts/adduser.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!@PYTHON@ # $Id$ # # Copyright (C) 2010 SPARTA, Inc. dba Cobham Analytic Solutions @@ -18,20 +18,26 @@ # # helper script to quickly set up a new portal-gui user/handle +import os, sys +sys.path.append('@INSTDIR@') +os.environ['DJANGO_SETTINGS_MODULE'] = 'rpkigui.settings' + from django.contrib.auth.models import User from django.conf import settings from rpkigui.myrpki.models import Conf +WEB_USER='@WEBUSER@' + import os import sys import hashlib import getpass import pwd -web_uid = pwd.getpwnam(settings.WEB_USER)[2] +web_uid = pwd.getpwnam(WEB_USER)[2] # FIXME: hardcoded for now -realm = 'myrpki' +realm = 'rpki' def user_has_password(passfile, username): 'returns True if username is found in the specified password file' diff --git a/portal-gui/scripts/helper.in b/portal-gui/scripts/helper.in deleted file mode 100755 index 6364be72..00000000 --- a/portal-gui/scripts/helper.in +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh -# $Id$ -# -# Copyright (C) 2010 SPARTA, Inc. dba Cobham Analytic Solutions -# -# 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. -# -# -# This is a wrapper script which sets the appropriate environment -# variables for invoking the portal-gui python scripts. -# -# @configure_input@ - -src=@INSTDIR@ -export PYTHONPATH=@MYRPKIDIR@:$src -export DJANGO_SETTINGS_MODULE=rpkigui.settings -@PYTHON@ $src/scripts/`basename $0`.py $* diff --git a/portal-gui/scripts/list_resources.py b/portal-gui/scripts/list_resources.py index f7abf3d2..54845563 100755..100644 --- a/portal-gui/scripts/list_resources.py +++ b/portal-gui/scripts/list_resources.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!@PYTHON@ # $Id$ # # Copyright (C) 2010 SPARTA, Inc. dba Cobham Analytic Solutions @@ -31,7 +31,11 @@ # later import sys +sys.path.append('@INSTDIR@') + import os +os.environ['DJANGO_SETTINGS_MODULE'] = 'rpkigui.settings' + from datetime import datetime import getopt from os.path import basename diff --git a/portal-gui/scripts/load_csv.py b/portal-gui/scripts/load_csv.py index 476539b9..29938b2d 100755 --- a/portal-gui/scripts/load_csv.py +++ b/portal-gui/scripts/load_csv.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!@PYTHON@ # $Id$ # # Copyright (C) 2010 SPARTA, Inc. dba Cobham Analytic Solutions @@ -24,7 +24,10 @@ # for the handle you are loading data # -import os +import sys, os +sys.path.append('@INSTDIR@') +os.environ['DJANGO_SETTINGS_MODULE'] = 'rpkigui.settings' + import csv import socket # for socket.error |