Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Reviewed-by: Dan Lavu <dlavu@redhat.com>
self.host.discard_file("/etc/gshadow")
return cmd
+
+ def chage(self, *args) -> ProcessResult:
+ """
+ Change user password expiry information.
+ """
+ args_dict = self._parse_args(args)
+ self.logger.info(f'Changing user password expiry information on user "{args_dict["name"]}" on {self.host.hostname}')
+ cmd = self.host.conn.run("chage " + args[0], log_level=ProcessLogLevel.Error)
+
+ self.host.discard_file("/etc/passwd")
+ self.host.discard_file("/etc/shadow")
+
+ return cmd