refactor project if used for terraform

This commit is contained in:
jem 2019-11-06 19:53:05 +01:00
parent 7f7b562409
commit 5a376ada87

View file

@ -15,8 +15,21 @@ def hetzner_api_key(project):
def stage(project): def stage(project):
return project.get_property('stage') return project.get_property('stage')
def module(project):
return project.get_property('name')
def tf_import_name(project): def tf_import_name(project):
return project.get_property('tf_import_name') return project.get_property('tf_import_name')
def tf_import_resource(project): def tf_import_resource(project):
return project.get_property('tf_import_resource') return project.get_property('tf_import_resource')
def project_dict(project):
my_hetzner_api_key = hetzner_api_key(project)
my_module = project.name
ret = {'stage' : stage(project)}
if my_hetzner_api_key:
ret['hetzner_api_key'] = my_hetzner_api_key
if my_module:
ret['module'] = my_module
return ret