Revision c1b1d444

b/ci/new_config
27 27

  
28 28

  
29 29
[Deployment]
30
# Credentials
31
auth_url = https://accounts.okeanos.io/identity/v2.0/
32
token =
30
# Choose the 'cloud' to use from .kamakirc
31
kamaki_cloud =
33 32
# If we deploy on okeanos.io we have to set this to True
34 33
# The server will reside besides a NAT and we have to compute ssh port
35 34
deploy_on_io = True
b/ci/setup_slave.py
10 10
def setup_slave():
11 11
    """Setup slave server"""
12 12
    synnefo_ci = SynnefoCI(cleanup_config=True)
13
    # Get token from /nfs/token
14
    try:
15
        token = open("/nfs/synnefo_token").read().strip()
16
        synnefo_ci.write_config('token', token, 'Deployment')
17
    except:
18
        pass
19 13
    # Build slave server
20 14
    synnefo_ci.create_server()
21 15
    # Copy synnefo repo to server
b/ci/utils.py
11 11
import fabric.api as fabric
12 12
from ConfigParser import ConfigParser, DuplicateSectionError
13 13

  
14
from kamaki.cli import config as kamaki_config
14 15
from kamaki.clients.astakos import AstakosClient
15 16
from kamaki.clients.cyclades import CycladesClient
16 17
from kamaki.clients.image import ImageClient
......
84 85
class SynnefoCI(object):
85 86
    """SynnefoCI python class"""
86 87

  
87
    def __init__(self, cleanup_config=False):
88
    def __init__(self, cleanup_config=False, cloud=None):
88 89
        """ Initialize SynnefoCI python class
89 90

  
90 91
        Setup logger, local_dir, config and kamaki
......
117 118
        else:
118 119
            self.config.read(self.config.get('Global', 'temporary_config'))
119 120

  
121
        # Set kamaki cloud
122
        if cloud is not None:
123
            self.kamaki_cloud = cloud
124
        elif self.config.has_option("Deployment", "kamaki_cloud"):
125
            kamaki_cloud = self.config.get("Deployment", "kamaki_cloud")
126
            if kamaki_cloud == "":
127
                self.kamaki_cloud = None
128
        else:
129
            self.kamaki_cloud = None
130

  
120 131
        # Initialize variables
121 132
        self.fabric_installed = False
122 133
        self.kamaki_installed = False
......
128 139

  
129 140
        Setup cyclades_client and image_client
130 141
        """
131
        self.logger.info("Setup kamaki client..")
132
        auth_url = self.config.get('Deployment', 'auth_url')
142

  
143
        config = kamaki_config.Config()
144
        if self.kamaki_cloud is None:
145
            self.kamaki_cloud = config.get_global("default_cloud")
146

  
147
        self.logger.info("Setup kamaki client, using cloud '%s'.." %
148
                         self.kamaki_cloud)
149
        auth_url = config.get_cloud(self.kamaki_cloud, "url")
133 150
        self.logger.debug("Authentication URL is %s" % _green(auth_url))
134
        token = self.config.get('Deployment', 'token')
151
        token = config.get_cloud(self.kamaki_cloud, "token")
135 152
        #self.logger.debug("Token is %s" % _green(token))
136 153

  
137 154
        astakos_client = AstakosClient(auth_url, token)

Also available in: Unified diff