Skip to content

Commit ac3014d

Browse files
authored
Merge pull request #1761 from jrha/indentation-openldap
ncm-openldap: Cleanup pan templates
2 parents 2bd3f64 + 293dd9b commit ac3014d

File tree

2 files changed

+17
-20
lines changed

2 files changed

+17
-20
lines changed

ncm-openldap/src/main/pan/components/openldap/config.pan

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ unique template components/${project.artifactId}/config;
66

77
include 'components/${project.artifactId}/schema';
88

9-
'/software/packages'=pkg_repl('ncm-${project.artifactId}','${no-snapshot-version}-${RELEASE}','noarch');
9+
'/software/packages' = pkg_repl('ncm-${project.artifactId}', '${no-snapshot-version}-${RELEASE}', 'noarch');
1010

1111
prefix '/software/components/${project.artifactId}';
12-
'dependencies/pre' ?= list ('spma');
12+
'dependencies/pre' ?= list('spma');
1313
'active' ?= true;
1414
'dispatch' ?= true;
1515
'version' = '${no-snapshot-version}';

ncm-openldap/src/main/pan/components/openldap/schema.pan

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ function openldap_loglevels_to_long = {
4444
lvls = list(default);
4545
};
4646

47-
total=0;
48-
foreach(idx;lvl;lvls) {
47+
total = 0;
48+
foreach(idx; lvl; lvls) {
4949
if(!exists(the_map[lvl])) {
5050
return(undef);
5151
};
@@ -59,31 +59,27 @@ function openldap_loglevels_to_long = {
5959

6060
@documentation{
6161
power of 2 (up to 64k)
62+
This is based on public domain code from http://graphics.stanford.edu/~seander/bithacks.html#DetermineIfPowerOf2
6263
}
63-
type long_pow2 = long with (SELF==1||SELF==2||SELF==4||SELF==8||
64-
SELF==16||SELF==32||SELF==64||SELF==128||SELF==256||SELF==512||
65-
SELF==1024||SELF==2048||SELF==4096||SELF==8192||SELF==16384||
66-
SELF==32768||SELF==65536||
67-
error("Only powers of two are accepted"));
64+
type long_pow2 = long(1..65535) with (SELF & (SELF - 1)) == 0 || error("Only powers of two are accepted");
6865

6966
@documentation{
7067
Possible acceptable values
7168
}
72-
type ldap_hash = string with match(SELF, '\{(S?(SHA|MD5))\}') ||
73-
error ("Only secure hashes are accepted here: {SSHA, SHA, SMD5, MD5}");
69+
type ldap_hash = string with match(SELF, '\{(S?(SHA|MD5))\}') || error(
70+
"Only secure hashes are accepted here: {SSHA, SHA, SMD5, MD5}"
71+
);
7472

7573
type ldap_sizelimit = {
7674
"soft" ? long
7775
"hard" ? long
78-
} with exists(SELF["soft"]) || exists(SELF["hard"]) ||
79-
error("Either 'soft' or 'hard' limits must be supplied");
76+
} with exists(SELF["soft"]) || exists(SELF["hard"]) || error("Either 'soft' or 'hard' limits must be supplied");
8077

8178
type ldap_buffer_size = {
8279
"listener" ? type_absoluteURI
8380
"read" ? long
8481
"write" ? long
85-
} with exists(SELF["read"]) || exists(SELF["write"]) ||
86-
error("Either 'read' or 'write' limits must be supplied");
82+
} with exists(SELF["read"]) || exists(SELF["write"]) || error("Either 'read' or 'write' limits must be supplied");
8783

8884
type ldap_access_item = {
8985
"who" ? string
@@ -181,12 +177,13 @@ type ldap_global = {
181177
};
182178

183179

184-
type ldap_database_string = string with
185-
match(SELF, "^(bdb|config|dnssrv|hdb|ldap|ldif|meta|monitor|null|passwd|perl|relay|shell|sql)$") ||
186-
error("Unknown LDAP database type. Check sladpd.conf man page");
180+
type ldap_database_string = string with match(SELF,
181+
"^(bdb|config|dnssrv|hdb|ldap|ldif|meta|monitor|null|passwd|perl|relay|shell|sql)$"
182+
) || error("Unknown LDAP database type. Check sladpd.conf man page");
187183

188-
type ldap_ops = string with
189-
match(SELF, '^(add|bind|compare|delete|modify|rename|search|read|write|(extended=\w+)|rename)$');
184+
type ldap_ops = string with match(SELF,
185+
'^(add|bind|compare|delete|modify|rename|search|read|write|(extended=\w+)|rename)$'
186+
);
190187

191188
type ldap_replica_retries = {
192189
"interval" : string

0 commit comments

Comments
 (0)