File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77from api .ssh import exec_ssh , connect_ssh
88
99import json
10+ import logging
1011import string
1112import subprocess
1213import uuid
1314
1415from api .models import Layer
1516from api .models import Node
1617
18+ logger = logging .getLogger (__name__ )
19+
1720# Collect details for connecting to the host machine
18- HOST_NODES_DIR = open ('/home/vagrant/.host_nodes_dir' ).read ().strip ()
19- PKEY = open ('/home/vagrant/.ssh/id_rsa' ).read ()
21+ try :
22+ HOST_NODES_DIR = open ('/home/vagrant/.host_nodes_dir' ).read ().strip ()
23+ PKEY = open ('/home/vagrant/.ssh/id_rsa' ).read ()
24+ except IOError as err :
25+ logger .warn (err )
2026
2127
2228def seed_flavors ():
23- """Seed the database with default flavors for each Rackspace region .
29+ """Seed the database with default flavors for vagrant .
2430
2531 :rtype: list of dicts containing flavor data
2632 """
2733 flavors = []
2834 for m in ['512' , '1024' , '2048' ]:
2935 flavors .append ({
30- 'id' : ' vagrant-{}' .format (m ),
36+ 'id' : " vagrant-{}" .format (m ),
3137 'provider' : 'vagrant' ,
3238 'params' : json .dumps ({
3339 'memory' : m
You can’t perform that action at this time.
0 commit comments