Exemplo n.º 1
0
 def __init__(self):
     '''
     Instantiate an RTSRoot object. Basically checks for configfs setup and
     base kernel modules (tcm)
     '''
     super(RTSRoot, self).__init__()
     modprobe('target_core_mod')
     self._create_in_cfs_ine('any')
Exemplo n.º 2
0
    def load(self, yield_steps=False):
        '''
        Attempt to load the target fabric kernel module as defined in the
        specfile.
        @param yield_steps: Whether or not to yield an (action, taken, desc)
        tuple at each step: action is either 'load_module' or
        'create_cfs_group', 'taken' is a bool indicating whether the action was
        taken (if needed) or not, and desc is a text description of the step
        suitable for logging.
        @type yield_steps: bool
        @raises RTSLibError: For failure to load kernel module and/or create
        configfs group.
        '''
        module = self.spec['kernel_module']
        load_module = modprobe(module)
        if yield_steps:
            yield ('load_module', load_module,
                   "Loaded %s kernel module." % module)

        # TODO: Also load saved targets and config if needed. For that, support
        #  XXX: from the configfs side would be nice: have a config ID present
        #  XXX: both on the on-disk saved config and a configfs attibute.

        # Create the configfs group
        self._create_in_cfs_ine('any')
        if yield_steps:
            yield ('create_cfs_group', self._fresh,
                   "Created '%s'." % self.path)
Exemplo n.º 3
0
 def _check_self(self):
     if not self.exists:
         modprobe(self.kernel_module)
         self._create_in_cfs_ine('any')
     super(_BaseFabricModule, self)._check_self()
Exemplo n.º 4
0
                               contexts.LoggregatorRelation,
                               contexts.EtcdRelation]},
            ]
    },

    'dea-v1': {
        'summary': 'DEA runs CF apps in containers',
        'description': '',
        'jobs': [
            {
                'job_name': 'dea_next',
                'mapping': {},
                'install': [
                    utils.install_linux_image_extra,
                    utils.apt_install(['quota']),
                    utils.modprobe(['quota_v1', 'quota_v2'])
                ],
                'required_data': [
                    contexts.NatsRelation,
                    contexts.LTCRelation,
                    contexts.DEARelation.remote_view,
                ],
                'data_ready': [
                    # Apply our workaround till we
                    # have a real fix
                    tasks.patch_dea
                ]
            },
            {
                'job_name': 'dea_logging_agent',
                'mapping': {},
Exemplo n.º 5
0
 def _check_self(self):
     if not self.exists:
         modprobe(self.kernel_module)
         self._create_in_cfs_ine('any')
     super(_BaseFabricModule, self)._check_self()