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
db.sqlite3
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
......@@ -97,16 +96,7 @@ ipython_config.py
# celery beat schedule file
celerybeat-schedule
# SageMath parsed files ✘ cgergo@cgergo  ~/mount/virtual/interface_openstack   vm ●  git status
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
# SageMath parsed files
*.sage.py
# Environments
......
......@@ -7,7 +7,6 @@ from image.models import Disk
from interface_openstack.implementation.vm.instance import (
OSVirtualMachineManager
)
import openstack
ACCESS_METHODS = tuple(
......@@ -43,8 +42,7 @@ class Flavor(models.Model):
@classmethod
def create(cls, name, description, ram=0, vcpu=0,
initial_disk=0, priority=0):
conn = openstack.connect(cloud="openstack")
interface = OSVirtualMachineManager(conn)
interface = OSVirtualMachineManager(settings.CONNECTION)
remote_flavor = interface.create_flavor(name, ram, vcpu, initial_disk)
flavor = cls(name=name, description=description,
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