'Retrieves the current config from the device or cache'

def get_config(self, flags=[]):

    cmd = 'display    current-configuration    '
    cmd += '    '.join(flags)
    cmd = cmd.strip()
    try:
        return self._device_configs[cmd]
    except KeyError:
        (rc, out, err) = self.exec_command(cmd)
        if (rc != 0):
            self._module.fail_json(msg=err)
        cfg = str(out).strip()
        for flag in flags:
            if ('include-default' in flag):
                cfg = rm_config_prefix(cfg)
                break
        self._device_configs[cmd] = cfg
        return cfg
