summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--man/bcfg2-remote.840
-rwxr-xr-xsrc/sbin/bcfg2-remote61
2 files changed, 0 insertions, 101 deletions
diff --git a/man/bcfg2-remote.8 b/man/bcfg2-remote.8
deleted file mode 100644
index 8e1aab956..000000000
--- a/man/bcfg2-remote.8
+++ /dev/null
@@ -1,40 +0,0 @@
-.TH "bcfg2-remote" 8
-.SH NAME
-bcfg2-remote \- Connect to a bcfg2 agent and trigger client execution
-.SH SYNOPSIS
-.B bcfg2-remote
-.I [-d <debug level>]
-.I [-H <agent host>]
-.I [-C <configfile>]
-.I [-k <ssl key>]
-.I [-p <agent tcp port>]
-.SH DESCRIPTION
-bcfg2-remote connects to a client agent, uses the server certificate
-for authentication, and causes that client to run the bcfg2 client
-code with the options specified on the client.
-.SH OPTIONS
-.PP
-.B "\-d debuglevel"
-.RS
-Set debug level (0-40).
-.RE
-.B "\-H hostname"
-.RS
-Connect to the agent on the specified host.
-.RE
-.B "-C configfile"
-.RS
-Use the specified bcfg2.conf.
-.RE
-.B "\-k sslkey"
-.RS
-Use the ssl certificate at the following path.
-.RE
-.B "\-p port"
-.RS
-Connect to the agent on the specified TCP port.
-.RE
-.SH "SEE ALSO"
-.BR bcfg2(1)
-
-
diff --git a/src/sbin/bcfg2-remote b/src/sbin/bcfg2-remote
deleted file mode 100755
index ee52d6201..000000000
--- a/src/sbin/bcfg2-remote
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/usr/bin/env python
-__revision__ = '$Revision$'
-
-from Bcfg2.tlslite.api import parsePEMKey, X509, X509CertChain
-from xmlrpclib import ServerProxy
-from Bcfg2.tlslite.integration.XMLRPCTransport import XMLRPCTransport
-import Bcfg2.Options, Bcfg2.Logger, logging, socket, sys
-
-if __name__ == '__main__':
- opts = {
- 'agent-port': Bcfg2.Options.AGENT_PORT,
- 'host': Bcfg2.Options.AGENT_HOST,
- 'setup': Bcfg2.Options.CFILE,
- 'key': Bcfg2.Options.SERVER_KEY,
- 'debug': Bcfg2.Options.DEBUG,
- }
- setup = Bcfg2.Options.OptionParser(opts)
- setup.parse(sys.argv[1:])
- Bcfg2.Logger.setup_logging('bcfg2-remote',
- to_syslog=False,
- level=int(setup['debug']))
- logger = logging.getLogger('bcfg2-remote')
- if not setup['host']:
- logger.error("-H option is required")
- logger.error(setup.buildHelpMessage())
- raise SystemExit(1)
- s = open(setup['key']).read()
- x509 = X509()
- x509.parse(s)
- certChain = X509CertChain([x509])
- #s = open("/etc/bcfg2.key").read()
- privateKey = parsePEMKey(s, private=True)
-
- transport = XMLRPCTransport(certChain=certChain,
- privateKey=privateKey)
- port = setup['agent-port']
- status = 0
- if setup['host'] == '-':
- urls = ["https://%s:%s" % (host, port) for host in \
- [line.strip() for line in sys.stdin.readlines()]]
- else:
- host = setup['host']
- urls = ["https://%s:%s" % (host, port)]
-
- for url in urls:
- server = ServerProxy(url, transport)
-
- try:
- result = server.run()
- except socket.error, serr:
- if serr.args[0] == 111:
- logger.error("Failed to connect to %s" % url)
- elif serr.args[0] == 32:
- logger.error("Connection to %s dropped; authentication failure?" % url)
- elif serr.args[0] == -5:
- logger.error("Lookup failure for %s" % url)
- else:
- logger.error("Got unexpected socket error %s for %s" % \
- (serr.args[0], url), exc_info=1)
- status = 1
- raise SystemExit(status)