diff options
Diffstat (limited to 'src/sbin')
-rwxr-xr-x | src/sbin/bcfg2 | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/sbin/bcfg2 b/src/sbin/bcfg2 index 0a4092b7f..039f5387a 100755 --- a/src/sbin/bcfg2 +++ b/src/sbin/bcfg2 @@ -166,12 +166,14 @@ class Client: self.logger.info("Running probe %s" % name) ret = Bcfg2.Client.XML.Element("probe-data", name=name, source=probe.get('source')) try: - script = open(tempfile.mktemp(), 'w+') + scripthandle, scriptname = tempfile.mkstemp() + script = open(scriptname, 'w+') try: script.write("#!%s\n" % (probe.attrib.get('interpreter', '/bin/sh'))) script.write(probe.text) script.close() + os.close(scripthandle) os.chmod(script.name, 0755) ret.text = os.popen(script.name).read().strip() self.logger.info("Probe %s has result:\n%s" % (name, ret.text)) |