Ignore:
Timestamp:
Feb 1, 2013 1:53:10 PM (12 years ago)
Author:
Ted Faber <faber@…>
Branches:
master
Children:
f7fc551
Parents:
328e93f
Message:

More principled default testbed handling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/federation/experiment_control.py

    r328e93f r17c6d91  
    139139        self.auth_dir = config.get('experiment_control', 'auth_dir')
    140140        self.routing = config.get('experiment_control', 'routing')
     141        self.default_tb = config.get('experiment_control', 'default_testbed')
    141142        # XXX: document this!
    142143        self.info_cache_limit = \
     
    23342335                if isinstance(e, topdl.Computer):
    23352336                    tb = e.get_attribute('testbed')
    2336                     # Put nodes not in a testbed into the 'default' testbed if
    2337                     # 'default' is in the fedd map, the instantiation will
    2338                     # work.
     2337                    # Put nodes not in a testbed into the default testbed if
     2338                    # there is one.
    23392339                    if tb is None:
    2340                         tb = 'default'
     2340                        if self.default_tb is None:
     2341                            raise service_error(service_error.req,
     2342                                '%s not in a testbed (and no default)' % e.name)
     2343                        tb = self.default_tb
    23412344                        e.set_attribute('testbed', tb)
    23422345                    if tb in tb_hosts: tb_hosts[tb].append(e.name)
Note: See TracChangeset for help on using the changeset viewer.