Commit e2bdaaa6 authored by Christos Stavrakakis's avatar Christos Stavrakakis
Browse files

Remove depricated settings and update migrations

parent d103e3d0
......@@ -3,11 +3,6 @@
# Ganeti backend configuration
###################################
# The RAPI endpoint and associated credentials to use
# for talking to the Ganeti backend.
GANETI_MASTER_IP = "10.0.0.1"
GANETI_CLUSTER_INFO = (GANETI_MASTER_IP, 5080, "username", "password")
# This prefix gets used when determining the instance names
# of Synnefo VMs at the Ganeti backend.
# The dash must always appear in the name!
......
......@@ -11,9 +11,12 @@ class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
try:
# Do NOT import external code as can be depricated when the
# migration will run
cluster_info = settings.GANETI_CLUSTER_INFO
except AttributeError:
raise AttributeError("Missing settings GANETI_CLUSTER_INFO")
except (AttributeError, ImportError):
return
(ip, port, username, password) = cluster_info
backend = orm.Backend.objects.create(clustername = ip,
port = port,
......
......@@ -10,9 +10,10 @@ class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
print '\033[91m' + 'Subnet of all networks is set to 10.0.0.0/24.'
print 'Gateway of all networks is set to null.'
print "Use `snf-manage network-modify` to change them." + '\033[0m'
if orm.Network.objects.exists():
print '\033[91m' + 'Subnet of all networks is set to 10.0.0.0/24.'
print 'Gateway of all networks is set to null.'
print "Use `snf-manage network-modify` to change them." + '\033[0m'
create_bridge = orm.BridgePool.objects.create
for link in orm.NetworkLink.objects.order_by('id').all():
......@@ -29,6 +30,8 @@ class Migration(DataMigration):
network.netlink = network.link.name
try:
# Do NOT import external code as can be depricated when the
# migration will run
base = settings.MAC_POOL_BASE
assert(len(base) == 7)
network.mac_prefix = base
......
......@@ -5,6 +5,8 @@ from south.v2 import DataMigration
from django.db import models
try:
# Do NOT import external code as can be depricated when the
# migration will run
from synnefo.db.aes_encrypt import encrypt_db_charfield as encrypt
from synnefo.db.aes_encrypt import decrypt_db_charfield as decrypt
except ImportError:
......
......@@ -37,6 +37,8 @@ class Migration(DataMigration):
bridges = orm.BridgePool.objects.all()
if bridges:
try:
# Do NOT import external code as can be depricated when the
# migration will run
pool_prefix = settings.PRIVATE_PHYSICAL_VLAN_BRIDGE_PREFIX
except AttributeError:
pool_prefix = ''
......@@ -65,6 +67,8 @@ class Migration(DataMigration):
mac_prefixes = orm.MacPrefixPool.objects.all()
if mac_prefixes:
try:
# Do NOT import external code as can be depricated when the
# migration will run
macp_base = settings.MAC_POOL_BASE
except AttributeError:
first = mac_prefixes[0]
......
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 to comment