summaryrefslogtreecommitdiffstats
path: root/config-db
diff options
context:
space:
mode:
authorOliver Tappe2007-11-29 14:10:34 +0100
committerOliver Tappe2007-11-29 14:10:34 +0100
commitc2204abe5c2e03232763fbcabb6e47030120f884 (patch)
tree25d8c7991b3a7ee505b42276128d2a86de3e386c /config-db
parent* when setting up the resolver for stage1a, we now copy nsswitch.conf from (diff)
downloadcore-c2204abe5c2e03232763fbcabb6e47030120f884.tar.gz
core-c2204abe5c2e03232763fbcabb6e47030120f884.tar.xz
core-c2204abe5c2e03232763fbcabb6e47030120f884.zip
* changed meaning of groups.priority such that it corresponds with sorting
order (0 means highest, 99 means lowest) * added method for getting the column names of a specific table git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1412 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'config-db')
-rw-r--r--config-db/OpenSLX/ConfigDB.pm30
-rw-r--r--config-db/OpenSLX/DBSchema.pm2
2 files changed, 30 insertions, 2 deletions
diff --git a/config-db/OpenSLX/ConfigDB.pm b/config-db/OpenSLX/ConfigDB.pm
index e286a4d7..0dfaffd7 100644
--- a/config-db/OpenSLX/ConfigDB.pm
+++ b/config-db/OpenSLX/ConfigDB.pm
@@ -257,6 +257,34 @@ sub rollbackTransaction
=over
+=cut
+
+=item C<getColumnsOfTable($tableName)>
+
+Returns the names of the columns of the given table.
+
+=over
+
+=item Param C<tableName>
+
+The name of the DB-table whose columns you'd like to retrieve.
+
+=item Return Value
+
+An array of column names.
+
+=back
+
+=cut
+
+sub getColumnsOfTable
+{
+ my $self = shift;
+ my $tableName = shift;
+
+ return map { (/^(\w+)\W/) ? $1 : $_; } @{$DbSchema->{tables}->{$tableName}};
+}
+
=item C<fetchVendorOSByFilter([%$filter], [$resultCols])>
Fetches and returns information about all vendor-OSes that match the given
@@ -2070,7 +2098,7 @@ sub mergeDefaultAndGroupAttributesIntoClient
# (ordered by priority from highest to lowest):
my @groupIDs = $self->fetchGroupIDsOfClient($client->{id});
my @groups =
- sort { $b->{priority} <=> $a->{priority} }
+ sort { $a->{priority} <=> $b->{priority} }
$self->fetchGroupByID(\@groupIDs);
foreach my $group (@groups) {
# merge configuration from this group into the current client:
diff --git a/config-db/OpenSLX/DBSchema.pm b/config-db/OpenSLX/DBSchema.pm
index d22f6eab..81a68399 100644
--- a/config-db/OpenSLX/DBSchema.pm
+++ b/config-db/OpenSLX/DBSchema.pm
@@ -169,7 +169,7 @@ $DbSchema = {
'name:s.128', # name of group
'comment:s.1024', # internal comment (optional, for admins)
'priority:i', # priority, used for order in group-list
- # (from 0-lowest to 10-highest)
+ # (from 0-highest to 99-lowest)
@sharedAttributes,
],
'group_client_ref' => [