Commit e71f3254 by Chif Gergő

Replace connection in flavor creare

parent 42a18ce9
Pipeline #775 failed with stages
in 17 seconds
...@@ -65,7 +65,6 @@ local_settings.py ...@@ -65,7 +65,6 @@ local_settings.py
db.sqlite3 db.sqlite3
# Flask stuff: # Flask stuff:
instance/
.webassets-cache .webassets-cache
# Scrapy stuff: # Scrapy stuff:
...@@ -97,16 +96,7 @@ ipython_config.py ...@@ -97,16 +96,7 @@ ipython_config.py
# celery beat schedule file # celery beat schedule file
celerybeat-schedule celerybeat-schedule
# SageMath parsed files ✘ cgergo@cgergo  ~/mount/virtual/interface_openstack   vm ●  git status # SageMath parsed files
On branch vm
Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: .gitignore
deleted: implementation/instance.py
deleted: implementation/instance.pyc
*.sage.py *.sage.py
# Environments # Environments
......
...@@ -7,7 +7,6 @@ from image.models import Disk ...@@ -7,7 +7,6 @@ from image.models import Disk
from interface_openstack.implementation.vm.instance import ( from interface_openstack.implementation.vm.instance import (
OSVirtualMachineManager OSVirtualMachineManager
) )
import openstack
ACCESS_METHODS = tuple( ACCESS_METHODS = tuple(
...@@ -43,8 +42,7 @@ class Flavor(models.Model): ...@@ -43,8 +42,7 @@ class Flavor(models.Model):
@classmethod @classmethod
def create(cls, name, description, ram=0, vcpu=0, def create(cls, name, description, ram=0, vcpu=0,
initial_disk=0, priority=0): initial_disk=0, priority=0):
conn = openstack.connect(cloud="openstack") interface = OSVirtualMachineManager(settings.CONNECTION)
interface = OSVirtualMachineManager(conn)
remote_flavor = interface.create_flavor(name, ram, vcpu, initial_disk) remote_flavor = interface.create_flavor(name, ram, vcpu, initial_disk)
flavor = cls(name=name, description=description, flavor = cls(name=name, description=description,
remote_id=remote_flavor.id, ram=ram, vcpu=vcpu, remote_id=remote_flavor.id, ram=ram, vcpu=vcpu,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment