From 303e93f65f029c3cfd84e12270a7b60462e0e379 Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Wed, 9 Apr 2014 18:29:46 +0000 Subject: [PATCH] Added a data migration for htpasswd import, to be run as part of the deployment of the django-auth release. - Legacy-Id: 7584 --- .../migrations/0001_import_htpasswd.py | 26 +++++++++++++++++++ ietf/ietfauth/migrations/__init__.py | 0 2 files changed, 26 insertions(+) create mode 100644 ietf/ietfauth/migrations/0001_import_htpasswd.py create mode 100644 ietf/ietfauth/migrations/__init__.py diff --git a/ietf/ietfauth/migrations/0001_import_htpasswd.py b/ietf/ietfauth/migrations/0001_import_htpasswd.py new file mode 100644 index 000000000..f26d707ed --- /dev/null +++ b/ietf/ietfauth/migrations/0001_import_htpasswd.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +from __future__ import print_function +from django.conf import settings +from south.v2 import DataMigration +from ietf.utils.management.commands.import_htpasswd import import_htpasswd_file + +class Migration(DataMigration): + + def forwards(self, orm): + "Write your forwards methods here." + # Note: Don't use "from appname.models import ModelName". + # Use orm.ModelName to refer to models in this application, + # and orm['appname.ModelName'] for models in other applications. + print("Importing password hashes from %s," % settings.HTPASSWD_FILE) + print("leaving entries without matching usernames alone.") + import_htpasswd_file(settings.HTPASSWD_FILE, verbosity=2) + + def backwards(self, orm): + "Write your backwards methods here." + + models = { + + } + + complete_apps = ['ietfauth'] + symmetrical = True diff --git a/ietf/ietfauth/migrations/__init__.py b/ietf/ietfauth/migrations/__init__.py new file mode 100644 index 000000000..e69de29bb