Revision ab419f67
b/snf-cyclades-app/synnefo/app_settings/default/backend.py | ||
---|---|---|
3 | 3 |
# Ganeti backend configuration |
4 | 4 |
################################### |
5 | 5 |
|
6 |
# The RAPI endpoint and associated credentials to use |
|
7 |
# for talking to the Ganeti backend. |
|
8 |
GANETI_MASTER_IP = "10.0.0.1" |
|
9 |
GANETI_CLUSTER_INFO = (GANETI_MASTER_IP, 5080, "username", "password") |
|
10 |
|
|
11 | 6 |
# This prefix gets used when determining the instance names |
12 | 7 |
# of Synnefo VMs at the Ganeti backend. |
13 | 8 |
# The dash must always appear in the name! |
b/snf-cyclades-app/synnefo/db/migrations/0035_default_backend.py | ||
---|---|---|
11 | 11 |
def forwards(self, orm): |
12 | 12 |
"Write your forwards methods here." |
13 | 13 |
try: |
14 |
# Do NOT import external code as can be depricated when the |
|
15 |
# migration will run |
|
14 | 16 |
cluster_info = settings.GANETI_CLUSTER_INFO |
15 |
except AttributeError: |
|
16 |
raise AttributeError("Missing settings GANETI_CLUSTER_INFO") |
|
17 |
except (AttributeError, ImportError): |
|
18 |
return |
|
19 |
|
|
17 | 20 |
(ip, port, username, password) = cluster_info |
18 | 21 |
backend = orm.Backend.objects.create(clustername = ip, |
19 | 22 |
port = port, |
b/snf-cyclades-app/synnefo/db/migrations/0037_network_migration.py | ||
---|---|---|
10 | 10 |
def forwards(self, orm): |
11 | 11 |
"Write your forwards methods here." |
12 | 12 |
|
13 |
print '\033[91m' + 'Subnet of all networks is set to 10.0.0.0/24.' |
|
14 |
print 'Gateway of all networks is set to null.' |
|
15 |
print "Use `snf-manage network-modify` to change them." + '\033[0m' |
|
13 |
if orm.Network.objects.exists(): |
|
14 |
print '\033[91m' + 'Subnet of all networks is set to 10.0.0.0/24.' |
|
15 |
print 'Gateway of all networks is set to null.' |
|
16 |
print "Use `snf-manage network-modify` to change them." + '\033[0m' |
|
16 | 17 |
|
17 | 18 |
create_bridge = orm.BridgePool.objects.create |
18 | 19 |
for link in orm.NetworkLink.objects.order_by('id').all(): |
... | ... | |
29 | 30 |
|
30 | 31 |
network.netlink = network.link.name |
31 | 32 |
try: |
33 |
# Do NOT import external code as can be depricated when the |
|
34 |
# migration will run |
|
32 | 35 |
base = settings.MAC_POOL_BASE |
33 | 36 |
assert(len(base) == 7) |
34 | 37 |
network.mac_prefix = base |
b/snf-cyclades-app/synnefo/db/migrations/0043_encrypt_passwords.py | ||
---|---|---|
5 | 5 |
from django.db import models |
6 | 6 |
|
7 | 7 |
try: |
8 |
# Do NOT import external code as can be depricated when the |
|
9 |
# migration will run |
|
8 | 10 |
from synnefo.db.aes_encrypt import encrypt_db_charfield as encrypt |
9 | 11 |
from synnefo.db.aes_encrypt import decrypt_db_charfield as decrypt |
10 | 12 |
except ImportError: |
b/snf-cyclades-app/synnefo/db/migrations/0052_migrate_pool_entries.py | ||
---|---|---|
37 | 37 |
bridges = orm.BridgePool.objects.all() |
38 | 38 |
if bridges: |
39 | 39 |
try: |
40 |
# Do NOT import external code as can be depricated when the |
|
41 |
# migration will run |
|
40 | 42 |
pool_prefix = settings.PRIVATE_PHYSICAL_VLAN_BRIDGE_PREFIX |
41 | 43 |
except AttributeError: |
42 | 44 |
pool_prefix = '' |
... | ... | |
65 | 67 |
mac_prefixes = orm.MacPrefixPool.objects.all() |
66 | 68 |
if mac_prefixes: |
67 | 69 |
try: |
70 |
# Do NOT import external code as can be depricated when the |
|
71 |
# migration will run |
|
68 | 72 |
macp_base = settings.MAC_POOL_BASE |
69 | 73 |
except AttributeError: |
70 | 74 |
first = mac_prefixes[0] |
Also available in: Unified diff