diff options
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/hostbase.py | 2 | ||||
-rwxr-xr-x | tools/hostbasepush.py | 16 |
2 files changed, 17 insertions, 1 deletions
diff --git a/tools/hostbase.py b/tools/hostbase.py index c25be3370..974577e69 100755 --- a/tools/hostbase.py +++ b/tools/hostbase.py @@ -62,4 +62,4 @@ if opts[0][0] == '-c': fd.close() os.system('vi + /tmp/hostbase.%s.tmp' % host.id) os.system('batchadd.py /tmp/hostbase.%s.tmp' % host.id) - + os.system('rm /tmp/hostbase.%s.tmp' % host.id) diff --git a/tools/hostbasepush.py b/tools/hostbasepush.py new file mode 100755 index 000000000..61f2e046b --- /dev/null +++ b/tools/hostbasepush.py @@ -0,0 +1,16 @@ +#!/usr/bin/python + +__revision__ = "$Revision: $" + +import Bcfg2.Client.Proxy, os + +if not os.getuid() == 0: + print 'this command must be run as root' + raise SystemExit + +proxy = Bcfg2.Client.Proxy.bcfg2() +print 'building files...' +proxy.run_method('Hostbase.rebuildState', ()) +print 'running bcfg...' +os.system('bcfg2 -q -d -v') + |