diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-01-12 02:26:25 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-01-12 02:26:25 +0100 |
commit | dd28dcf3d620a4ac7d0a1532b812213cf094cd3c (patch) | |
tree | a3fa8c8ef446de2bcc2f317bceb4bca868f7e0f0 /modules/profiles/files/node-classifier.py | |
parent | Move webdav into profiles. (diff) | |
download | webdav_server-dd28dcf3d620a4ac7d0a1532b812213cf094cd3c.tar.gz webdav_server-dd28dcf3d620a4ac7d0a1532b812213cf094cd3c.tar.xz |
Revert "Move webdav into profiles."
It actually reverts the non-need for the nginx module webdav_ext. Since
Omnifocus requires PROPFIND.
This reverts commit edf6ffe8b399679ba28cc5e558a6838919dd1ee8.
Diffstat (limited to 'modules/profiles/files/node-classifier.py')
-rw-r--r-- | modules/profiles/files/node-classifier.py | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/modules/profiles/files/node-classifier.py b/modules/profiles/files/node-classifier.py deleted file mode 100644 index 7fc096f..0000000 --- a/modules/profiles/files/node-classifier.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env python3 - -import yaml -import sys -import configparser - -# https://puppet.com/docs/puppet/7/nodes_external.html - - -def main(args): - if len(args) == 1: - print('usage ./node-classifier <node-name>') - return - - parser = configparser.ConfigParser() - conf_file = '/etc/node-classifier.ini' - if parser.read(conf_file) != [conf_file]: - print(f'Configuration file missing, expected {conf_file}') - return 1 - - try: - fmt = parser.get('common', 'node_fmt') - if fmt != 'yaml': - print(f'Unknown format {fmt}') - return 1 - filename = parser.get('common', 'nodes') - except configparser.NoSectionError as e: - print(e) - return 1 - except NoOptionError as e: - print(e) - return 1 - - with open(filename) as f: - data = yaml.load(f) - - nodename = sys.argv[1] - instance = data.get(nodename) - if not instance: - instance = data.get('default') - print(yaml.dump(instance)) - -if __name__ == '__main__': - sys.exit(main(sys.argv)) |