summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--man/bcfg2.15
-rw-r--r--src/lib/Options.py3
-rw-r--r--src/lib/Server/Admin/Perf.py4
-rw-r--r--src/lib/Server/Admin/Xcmd.py5
-rwxr-xr-xsrc/sbin/bcfg210
5 files changed, 20 insertions, 7 deletions
diff --git a/man/bcfg2.1 b/man/bcfg2.1
index 938d41dfe..7f108ed8f 100644
--- a/man/bcfg2.1
+++ b/man/bcfg2.1
@@ -147,6 +147,11 @@ Attempt to authenticate as 'user'.
Use 'password' for client communication.
.TP
+.BR "\-t <timeout>"
+Set the timeout (in seconds) for client communication. Default is 90
+seconds.
+
+.TP
.BR "\-v"
Run bcfg2 in verbose mode.
.RE
diff --git a/src/lib/Options.py b/src/lib/Options.py
index 26d0fa349..e6eebb808 100644
--- a/src/lib/Options.py
+++ b/src/lib/Options.py
@@ -317,6 +317,9 @@ CLIENT_USER = Option('The user to provide for authentication', default='root',
cmd='-u', cf=('communication', 'user'), odesc='<user>')
CLIENT_SERVICE_MODE = Option('Set client service mode', default='default',
cmd='-s', odesc='<default|disabled|build>')
+CLIENT_TIMEOUT = Option('Set the client XML-RPC timeout', default=90,
+ cmd='-t', cf=('communication', 'timeout'),
+ odesc='<timeout>')
# APT client tool options
CLIENT_APT_TOOLS_INSTALL_PATH = Option('Apt tools install path',
diff --git a/src/lib/Server/Admin/Perf.py b/src/lib/Server/Admin/Perf.py
index af1c83072..d03b37d57 100644
--- a/src/lib/Server/Admin/Perf.py
+++ b/src/lib/Server/Admin/Perf.py
@@ -22,6 +22,7 @@ class Perf(Bcfg2.Server.Admin.Mode):
'password': Bcfg2.Options.SERVER_PASSWORD,
'server': Bcfg2.Options.SERVER_LOCATION,
'user': Bcfg2.Options.CLIENT_USER,
+ 'timeout': Bcfg2.Options.CLIENT_TIMEOUT,
}
setup = Bcfg2.Options.OptionParser(optinfo)
setup.parse(sys.argv[2:])
@@ -30,7 +31,8 @@ class Perf(Bcfg2.Server.Admin.Mode):
setup['password'],
key=setup['key'],
cert=setup['certificate'],
- ca=setup['ca'])
+ ca=setup['ca'],
+ timeout=setup['timeout'])
data = proxy.get_statistics()
for key, value in list(data.items()):
data = tuple(["%.06f" % (item) for item in value[:-1]] + [value[-1]])
diff --git a/src/lib/Server/Admin/Xcmd.py b/src/lib/Server/Admin/Xcmd.py
index fd5794f88..2cb085346 100644
--- a/src/lib/Server/Admin/Xcmd.py
+++ b/src/lib/Server/Admin/Xcmd.py
@@ -20,7 +20,8 @@ class Xcmd(Bcfg2.Server.Admin.Mode):
'password': Bcfg2.Options.SERVER_PASSWORD,
'key': Bcfg2.Options.SERVER_KEY,
'certificate': Bcfg2.Options.CLIENT_CERT,
- 'ca': Bcfg2.Options.CLIENT_CA
+ 'ca': Bcfg2.Options.CLIENT_CA,
+ 'timeout': Bcfg2.Options.CLIENT_TIMEOUT,
}
setup = Bcfg2.Options.OptionParser(optinfo)
setup.parse(sys.argv[2:])
@@ -31,7 +32,7 @@ class Xcmd(Bcfg2.Server.Admin.Mode):
key=setup['key'],
cert=setup['certificate'],
ca=setup['ca'],
- timeout=180)
+ timeout=setup['timeout'])
if len(setup['args']) == 0:
print("Usage: xcmd <xmlrpc method> <optional arguments>")
return
diff --git a/src/sbin/bcfg2 b/src/sbin/bcfg2
index eb41af640..534ab8238 100755
--- a/src/sbin/bcfg2
+++ b/src/sbin/bcfg2
@@ -75,6 +75,7 @@ class Client:
'certificate': Bcfg2.Options.CLIENT_CERT,
'ca': Bcfg2.Options.CLIENT_CA,
'serverCN': Bcfg2.Options.CLIENT_SCNS,
+ 'timeout': Bcfg2.Options.CLIENT_TIMEOUT,
}
self.setup = Bcfg2.Options.OptionParser(optinfo)
@@ -178,10 +179,11 @@ class Client:
proxy = Bcfg2.Proxy.ComponentProxy(self.setup['server'],
self.setup['user'],
self.setup['password'],
- key = self.setup['key'],
- cert = self.setup['certificate'],
- ca = self.setup['ca'],
- allowedServerCNs = self.setup['serverCN'])
+ key=self.setup['key'],
+ cert=self.setup['certificate'],
+ ca=self.setup['ca'],
+ allowedServerCNs=self.setup['serverCN'],
+ timeout=self.setup['timeout'])
if self.setup['profile']:
try: