aboutsummaryrefslogtreecommitdiff
path: root/import_yaml.py
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-08-08 20:36:37 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2022-08-08 20:36:37 +0200
commit402a5afdb5fc9b73daa3cd33400ede300d26b793 (patch)
tree103474d05f0ae758c127ba3fe3b3edb988e76358 /import_yaml.py
parentwork (diff)
downloadpuppet-classifier-402a5afdb5fc9b73daa3cd33400ede300d26b793.tar.gz
puppet-classifier-402a5afdb5fc9b73daa3cd33400ede300d26b793.tar.xz
Rename some database stuff.
Diffstat (limited to 'import_yaml.py')
-rwxr-xr-ximport_yaml.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/import_yaml.py b/import_yaml.py
index d602cad..0007e75 100755
--- a/import_yaml.py
+++ b/import_yaml.py
@@ -19,16 +19,16 @@ for fqdn, val in data.items():
h = model.Host.query.where(model.Host.fqdn == fqdn).first()
if not h:
h = model.Host(fqdn=fqdn)
- h.environment = model.PuppetEnvironment \
+ h.environment = model.Environment \
.query \
- .where(model.PuppetEnvironment.name == val.get('environment', 'production')) \
+ .where(model.Environment.name == val.get('environment', 'production')) \
.one()
classes = val['classes']
if type(classes) == dict:
classes = classes.keys()
cls = model.PuppetClass.query \
- .where(model.PuppetClass.class_name.in_(classes)).all()
+ .where(model.PuppetClass.name.in_(classes)).all()
print(cls)
h.classes.extend(cls)