Example #1
0
    def get_storage(self):
        ''' Load a StorageInfo class.  Probe if it's not present '''
        if 'storage' not in self.probe_data:
            log.debug('get_storage: no storage in probe_data, fetching')
            storage = Storage()
            results = storage.probe()
            self.probe_data['storage'] = results

        return self.probe_data['storage']
Example #2
0
    def get_storage(self, probe_types=None):
        ''' Load a StorageInfo class.  Probe if it's not present '''
        if 'storage' not in self.probe_data:
            log.debug('get_storage: no storage in probe_data, fetching')
            storage = Storage()
            results = storage.probe(probe_types=probe_types)
            self.probe_data['storage'] = results

        if self.opts.machine_config is not None and probe_types is not None:
            r = self.saved_config['storage'].copy()
            for k in self.saved_config['storage']:
                if k not in probe_types:
                    r[k] = {}
            return r
        return self.probe_data['storage']
Example #3
0
class Prober():
    def __init__(self):
        self._results = {}

    def probe_all(self):
        self.probe_storage()
        self.probe_network()

    def probe_storage(self):
        from probert.storage import Storage
        self._storage = Storage()
        self._results['storage'] = self._storage.probe()

    def probe_network(self):
        from probert.network import NetworkProber
        self._network = NetworkProber()
        self._results['network'] = self._network.probe()

    def get_results(self):
        return self._results
Example #4
0
 def probe_storage(self):
     storage = Storage()
     results = storage.probe()
     self.results['storage'] = results