Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
olemathias committed Apr 7, 2022
2 parents 0287a4b + 801adba commit 5df27da
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions orc/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
DEBUG = os.environ.get('DEBUG', 'True').lower() == 'true'

ALLOWED_HOSTS = os.environ.get('ALLOWED_HOSTS', '*').split(' ')
CSRF_TRUSTED_ORIGINS = os.environ.get('CSRF_TRUSTED_ORIGINS', '*').split(' ')

FORCE_SCRIPT_NAME = os.environ.get('FORCE_SCRIPT_NAME', None)

Expand Down
3 changes: 3 additions & 0 deletions vm/proxmox.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
def find_pve_template(pve_node, template):
pve_vm_templates = []
for t in pve_node.qemu.get():
print(t['name'])
if re.match(template.config['pve_template'], t['name']) is not None:
pve_vm_templates.append(pve_node.qemu(t['vmid']))

Expand All @@ -33,6 +34,8 @@ def create_qemu_vm_job(vm_id, pve_node_name):
vm.state['proxmox'] = {}

pve_node = vm.platform.proxmox().nodes(pve_node_name)
if pve_node is None:
raise Exception('Failed to connect to pve node')
pve_vm_template = find_pve_template(pve_node, vm.template)
if pve_vm_template is None:
raise Exception('VM Template not found, or more then one found')
Expand Down

0 comments on commit 5df27da

Please sign in to comment.