summaryrefslogtreecommitdiffstats
path: root/src/sbin
diff options
context:
space:
mode:
authorSol Jerome <solj@ices.utexas.edu>2009-05-12 18:11:12 +0000
committerSol Jerome <solj@ices.utexas.edu>2009-05-12 18:11:12 +0000
commit81baada0400d8c801ff6f0feea3f25ec14ed9228 (patch)
tree4cc543aba7d6cbf63f63c866c684bb78121fb61e /src/sbin
parentb2857bb34e219f445053366cbfa6f371d0718639 (diff)
downloadbcfg2-81baada0400d8c801ff6f0feea3f25ec14ed9228.tar.gz
bcfg2-81baada0400d8c801ff6f0feea3f25ec14ed9228.tar.bz2
bcfg2-81baada0400d8c801ff6f0feea3f25ec14ed9228.zip
Cleaned up agent mode options and added cmd line options for SSL rework
Signed-off-by: Sol Jerome <solj@ices.utexas.edu> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5222 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/sbin')
-rwxr-xr-xsrc/sbin/bcfg231
1 files changed, 11 insertions, 20 deletions
diff --git a/src/sbin/bcfg2 b/src/sbin/bcfg2
index c2fb25121..070561dd9 100755
--- a/src/sbin/bcfg2
+++ b/src/sbin/bcfg2
@@ -6,7 +6,6 @@ __revision__ = '$Revision$'
import logging
import os
import signal
-import socket
import sys
import tempfile
import time
@@ -63,9 +62,6 @@ class Client:
'password': Bcfg2.Options.SERVER_PASSWORD,
'retries': Bcfg2.Options.CLIENT_RETRIES,
'kevlar': Bcfg2.Options.CLIENT_KEVLAR,
- 'agent': Bcfg2.Options.CLIENT_AGENT,
- 'agent-port': Bcfg2.Options.CLIENT_PORT,
- 'agent-background': Bcfg2.Options.CLIENT_BACKGROUND,
'key': Bcfg2.Options.SERVER_KEY,
'decision-list': DECISION_LIST,
'encoding': Bcfg2.Options.ENCODING,
@@ -90,7 +86,10 @@ class Client:
level = 20
if self.setup['debug']:
level = 0
- Bcfg2.Logger.setup_logging('bcfg2', to_syslog=False, level=level, to_file=self.setup['filelog'])
+ Bcfg2.Logger.setup_logging('bcfg2',
+ to_syslog=False,
+ level=level,
+ to_file=self.setup['filelog'])
self.logger = logging.getLogger('bcfg2')
self.logger.debug(self.setup)
if 'drivers' in self.setup and self.setup['drivers'] == 'help':
@@ -104,21 +103,14 @@ class Client:
if (self.setup["file"] != False) and (self.setup["cache"] != False):
print("cannot use -f and -c together")
raise SystemExit(1)
- if (self.setup["agent"] != False) and (self.setup["interactive"] != False):
- print("cannot use -A and -I together")
- raise SystemExit(1)
- if (self.setup["agent"] and not self.setup["fingerprint"]):
- print("Agent mode requires specification of x509 fingerprint")
- raise SystemExit(1)
- if (self.setup["agent"] and not self.setup["key"]):
- print("Agent mode requires specification of ssl cert + key file")
- raise SystemExit(1)
def run_probe(self, probe):
'''Execute probe'''
name = probe.get('name')
self.logger.info("Running probe %s" % name)
- ret = Bcfg2.Client.XML.Element("probe-data", name=name, source=probe.get('source'))
+ ret = Bcfg2.Client.XML.Element("probe-data",
+ name=name,
+ source=probe.get('source'))
try:
scripthandle, scriptname = tempfile.mkstemp()
script = open(scriptname, 'w+')
@@ -141,10 +133,7 @@ class Client:
def fatal_error(self, message):
'''Signal a fatal error'''
self.logger.error("Fatal error: %s" % (message))
- if not self.setup["agent"]:
- raise SystemExit(1)
- else:
- self.logger.error("Continuing...")
+ raise SystemExit(1)
def run(self):
''' Perform client execution phase '''
@@ -292,7 +281,9 @@ class Client:
feedback = self.tools.GenerateStats()
try:
- proxy.RecvStats(Bcfg2.Client.XML.tostring(feedback, encoding='UTF-8', xml_declaration=True))
+ proxy.RecvStats(Bcfg2.Client.XML.tostring(feedback,
+ encoding='UTF-8',
+ xml_declaration=True))
except xmlrpclib.Fault:
self.logger.error("Failed to upload configuration statistics")
raise SystemExit(2)