'Gathers facts for DeploymentConfigs in logging namespace'

def facts_for_deploymentconfigs(self, namespace):

    self.default_keys_for('deploymentconfigs')
    dclist = self.oc_command('get', 'deploymentconfigs', namespace=namespace, add_options=['-l', LOGGING_INFRA_KEY])
    if (len(dclist['items']) == 0):
        return
    dcs = dclist['items']
    for dc_item in dcs:
        name = dc_item['metadata']['name']
        comp = self.comp(name)
        if (comp is not None):
            spec = dc_item['spec']['template']['spec']
            facts = dict(selector=dc_item['spec']['selector'], replicas=dc_item['spec']['replicas'], serviceAccount=spec['serviceAccount'], containers=dict(), volumes=dict())
            if ('volumes' in spec):
                for vol in spec['volumes']:
                    clone = copy.deepcopy(vol)
                    clone.pop('name', None)
                    facts['volumes'][vol['name']] = clone
            for container in spec['containers']:
                facts['containers'][container['name']] = dict(image=container['image'], resources=container['resources'])
            self.add_facts_for(comp, 'deploymentconfigs', name, facts)
