def cli(self, interface='', output=None):
    if (output is None):
        if interface:
            cmd = self.cli_command[1].format(interface=interface)
        else:
            cmd = self.cli_command[0]
        out = self.device.get(cmd).json()['response']
    else:
        out = output
    result_dict = {}
    for intf_dict in out:
        result_dict[intf_dict['portName']] = {k: v for (k, v) in intf_dict.items() if (v is not None)}
    return result_dict
def cli(self, interface=, output=None):
    if (output is None):
        if interface:
            cmd = self.cli_command[1].format(interface=interface)
        else:
            cmd = self.cli_command[0]
        out = self.device.get(cmd).json()['response']
    else:
        out = output
    result_dict = {}
    for intf_dict in out:
        result_dict[intf_dict['portName']] = {k: v for (k, v) in intf_dict.items() if (v is not None)}
    return result_dict