文件操作 - grpc.py
返回文件管理
返回主菜单
删除本文件
文件: /usr/lib/python3.12/site-packages/ansible_collections/ansible/netcommon/plugins/action/grpc.py
编辑文件内容
# # Copyright 2022 Red Hat Inc. # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # SPDX-License-Identifier: GPL-3.0-or-later from __future__ import absolute_import, division, print_function __metaclass__ = type from ansible_collections.ansible.netcommon.plugins.action.network import ( ActionModule as ActionNetworkModule, ) class ActionModule(ActionNetworkModule): def run(self, tmp=None, task_vars=None): del tmp # tmp no longer has any effect self._config_module = True warnings = [] if self._play_context.connection.split(".")[-1] != "grpc": return { "failed": True, "msg": "Connection type %s is not valid for grpc module. " "Valid connection type is grpc" % self._play_context.connection, } result = super(ActionModule, self).run(task_vars=task_vars) if warnings: if "warnings" in result: result["warnings"].extend(warnings) else: result["warnings"] = warnings return result
修改文件时间
将文件时间修改为当前时间的前一年
删除文件