'Retrieves the current config from the device or cache'

def get_config(self, flags=[]):

    cmd = 'show    running-config    '
    cmd += '    '.join(flags)
    cmd = cmd.strip()
    try:
        return self._device_configs[cmd]
    except KeyError:
        out = self.send_request(cmd)
        cfg = str(out['result'][0]['output']).strip()
        self._device_configs[cmd] = cfg
        return cfg
