Compare commits

...

3 Commits
0.1 ... master

Author SHA1 Message Date
Gibheer 6c2e5ff1d8 python wants all commands to be a list
This resolves an error with pythons subprocess module, where it expects
a list of command line arguments.
2020-02-27 19:01:55 +01:00
Gibheer 29927fd050 write extra line break
This resolves an error with nsd, that expects a final linebreak.
2020-02-27 19:01:33 +01:00
Gibheer 5e0cac8118 install config as sample file in etc
This should make it easier to package it and also use proper location
for the example config.
2020-02-27 12:10:47 +01:00
3 changed files with 6 additions and 5 deletions

View File

@ -49,19 +49,20 @@ if __name__ == "__main__":
try:
with open(filepath, 'w+', 0644) as fp:
fp.write(output)
fp.write("\n")
except IOError as e:
print("could not write zone file '%s': %s" % (update['zone_name'], e))
sys.exit(-1)
if update['action'] == 'create_zone' and config.has_option('command', 'add_zone'):
command = config.get('command', 'add_zone') % (update['zone_name'])
subprocess.call(command)
subprocess.call(command.split(' '))
elif update['action'] != 'create_zone' and config.has_option('command', 'reload_zone'):
command = config.get('command', 'reload_zone') % (update['zone_name'])
subprocess.call(command)
subprocess.call(command.split(' '))
elif update['action'] == 'delete_zone':
os.remove(filepath)
if config.has_option('command', 'del_zone'):
command = config.get('command', 'del_zone') % (update['zone_name'])
subprocess.call(command)
subprocess.call(command.split(' '))
c.output_update_delete([update['id']])

View File

@ -1,8 +1,8 @@
from distutils.core import setup
setup(name='dim_output_bind',
version='0.1',
version='0.2',
description='A plugin to write bind files from dim output.',
scripts=['dim_output_bind'],
data_files=[('share/dim_outout_bind', ['dim_output_bind.ini'])],
data_files=[('etc/', ['dim_output_bind.ini.sample'])],
install_requires=['dimclient>=0.4.2'])