summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2006-02-20 22:35:00 +0000
committerNarayan Desai <desai@mcs.anl.gov>2006-02-20 22:35:00 +0000
commitce1bfa63fcedb45ca3951c24f6e48478c048d9a5 (patch)
treea50bdfa95d9d169c43432dd8a3a67ba7fcbae4fc
parent045d7efed0d6739f4c664499caaa84bd7cc6d935 (diff)
downloadbcfg2-ce1bfa63fcedb45ca3951c24f6e48478c048d9a5.tar.gz
bcfg2-ce1bfa63fcedb45ca3951c24f6e48478c048d9a5.tar.bz2
bcfg2-ce1bfa63fcedb45ca3951c24f6e48478c048d9a5.zip
add extra support for client profile assertion
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@1749 ce84e21b-d406-0410-9b95-82705330c041
-rwxr-xr-xsrc/sbin/bcfg2-server20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/sbin/bcfg2-server b/src/sbin/bcfg2-server
index dafc8be1e..2d9ceb92b 100755
--- a/src/sbin/bcfg2-server
+++ b/src/sbin/bcfg2-server
@@ -94,6 +94,7 @@ class Bcfg2Serv(Bcfg2.Server.Component.Component):
fatal_error(msg)
self.funcs.update({
+ "AssertProfile": self.Bcfg2AssertProfile,
"GetConfig": self.Bcfg2GetConfig,
"GetProbes": self.Bcfg2GetProbes,
"RecvProbeData": self.Bcfg2RecvProbeData,
@@ -164,17 +165,20 @@ class Bcfg2Serv(Bcfg2.Server.Component.Component):
critical_error('error in probe data receipt')
return True
+ def Bcfg2AssertProfile(self, address, profile):
+ '''Set profile for a client'''
+ client = self.resolve_client(address[0])
+ try:
+ self.Core.metadata.set_group(client, profile)
+ except MetadataConsistencyError:
+ warning = 'metadata consistency error'
+ self.logger.warning(warning)
+ raise Fault, (6, warning)
+ return True
+
def Bcfg2GetConfig(self, address, image=False, profile=False):
'''Build config for a client'''
client = self.resolve_client(address[0])
-
- if image and profile:
- try:
- self.Core.metadata.set_group(client, profile)
- except MetadataConsistencyError:
- warning = 'metadata consistency error'
- self.logger.warning(warning)
- raise Fault, (6, warning)
return tostring(self.Core.BuildConfiguration(client))
def Bcfg2RecvStats(self, address, stats):