aboutsummaryrefslogtreecommitdiffstats
path: root/modules/django_application
diff options
context:
space:
mode:
authorThomas Backlund <tmb@mageia.org>2015-10-20 00:24:20 +0300
committerThomas Backlund <tmb@mageia.org>2015-10-20 00:24:20 +0300
commit544b4fe3761088699ebad6a493b3b3c91cc72ea1 (patch)
treeba65938087b82a9f015fcd45b96a3d0772266b15 /modules/django_application
parent6c2a31c7d305bbf436dfb283e1bf619a9fc0f3ac (diff)
downloadpuppet-544b4fe3761088699ebad6a493b3b3c91cc72ea1.tar
puppet-544b4fe3761088699ebad6a493b3b3c91cc72ea1.tar.gz
puppet-544b4fe3761088699ebad6a493b3b3c91cc72ea1.tar.bz2
puppet-544b4fe3761088699ebad6a493b3b3c91cc72ea1.tar.xz
puppet-544b4fe3761088699ebad6a493b3b3c91cc72ea1.zip
lint fixes for django_application
Diffstat (limited to 'modules/django_application')
-rw-r--r--modules/django_application/files/custom_backend.py4
-rw-r--r--modules/django_application/files/django_add_permission_to_group.py10
-rw-r--r--modules/django_application/files/django_create_group.py2
-rw-r--r--modules/django_application/manifests/add_permission_to_group.pp7
-rw-r--r--modules/django_application/manifests/create_group.pp6
-rw-r--r--modules/django_application/manifests/script.pp4
6 files changed, 14 insertions, 19 deletions
diff --git a/modules/django_application/files/custom_backend.py b/modules/django_application/files/custom_backend.py
index 828744fb..5ab35385 100644
--- a/modules/django_application/files/custom_backend.py
+++ b/modules/django_application/files/custom_backend.py
@@ -1,9 +1,7 @@
-from django_auth_ldap.backend import LDAPBackend,_LDAPUser
+from django_auth_ldap.backend import LDAPBackend,_LDAPUser
class ForceUidLDAPBackend(LDAPBackend):
def ldap_to_django_username(self, username):
# force uid if someone give a email
return _LDAPUser(self, username=username).attrs['uid'][0]
-
-
diff --git a/modules/django_application/files/django_add_permission_to_group.py b/modules/django_application/files/django_add_permission_to_group.py
index 4fa77e8d..69ac7be5 100644
--- a/modules/django_application/files/django_add_permission_to_group.py
+++ b/modules/django_application/files/django_add_permission_to_group.py
@@ -16,12 +16,12 @@ if app:
permissions = permissions.filter(content_type__app_label__exact=app)
if len(permissions) > 1:
- print "Error, result not unique, please give the application among :"
- print ' '.join([p.content_type.app_label for p in permissions])
- sys.exit(1)
+ print "Error, result not unique, please give the application among :"
+ print ' '.join([p.content_type.app_label for p in permissions])
+ sys.exit(1)
elif len(permissions) < 1:
- print "Error, wrong codename"
- sys.exit(1)
+ print "Error, wrong codename"
+ sys.exit(1)
group.permissions.add(permissions[0])
group.save()
diff --git a/modules/django_application/files/django_create_group.py b/modules/django_application/files/django_create_group.py
index 69079f66..b5052217 100644
--- a/modules/django_application/files/django_create_group.py
+++ b/modules/django_application/files/django_create_group.py
@@ -8,5 +8,3 @@ try:
except Group.DoesNotExist:
group = Group.objects.create(name=group_name)
group.save()
-
-
diff --git a/modules/django_application/manifests/add_permission_to_group.pp b/modules/django_application/manifests/add_permission_to_group.pp
index 037ec882..6e0663ed 100644
--- a/modules/django_application/manifests/add_permission_to_group.pp
+++ b/modules/django_application/manifests/add_permission_to_group.pp
@@ -2,11 +2,10 @@ define django_application::add_permission_to_group( $path,
$module,
$group,
$app='') {
- exec { "/usr/local/bin/django_add_permission_to_group.py $group $name $app":
+ exec { "/usr/local/bin/django_add_permission_to_group.py ${group} ${name} ${app}":
user => 'root',
- environment => ["DJANGO_SETTINGS_MODULE=$module.settings",
- "PYTHONPATH=$path" ],
+ environment => ["DJANGO_SETTINGS_MODULE=${module}.settings",
+ "PYTHONPATH=${path}" ],
require => Django_application::Script['django_add_permission_to_group.py']
}
}
-
diff --git a/modules/django_application/manifests/create_group.pp b/modules/django_application/manifests/create_group.pp
index 26a9a811..1931205f 100644
--- a/modules/django_application/manifests/create_group.pp
+++ b/modules/django_application/manifests/create_group.pp
@@ -1,8 +1,8 @@
define django_application::create_group($path, $module) {
- exec { "/usr/local/bin/django_create_group.py $name":
+ exec { "/usr/local/bin/django_create_group.py ${name}":
user => 'root',
- environment => ["DJANGO_SETTINGS_MODULE=$module.settings",
- "PYTHONPATH=$path" ],
+ environment => ["DJANGO_SETTINGS_MODULE=${module}.settings",
+ "PYTHONPATH=${path}" ],
require => Django_application::Script['django_create_group.py']
}
}
diff --git a/modules/django_application/manifests/script.pp b/modules/django_application/manifests/script.pp
index 96179c96..f414d864 100644
--- a/modules/django_application/manifests/script.pp
+++ b/modules/django_application/manifests/script.pp
@@ -1,8 +1,8 @@
define django_application::script() {
file { $name:
- path => "/usr/local/bin/$name",
+ path => "/usr/local/bin/${name}",
mode => '0755',
- source => "puppet:///modules/django_application/$name",
+ source => "puppet:///modules/django_application/${name}",
}
}