mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-05 13:44:24 -07:00
sysrc: remove re import and set errno.EACCES on the OSError
This commit is contained in:
parent
58e6c1ca25
commit
89bba88211
1 changed files with 1 additions and 2 deletions
|
@ -106,7 +106,6 @@ from ansible_collections.community.general.plugins.module_utils.module_helper im
|
||||||
|
|
||||||
import errno
|
import errno
|
||||||
import os
|
import os
|
||||||
import re
|
|
||||||
|
|
||||||
class Sysrc(StateModuleHelper):
|
class Sysrc(StateModuleHelper):
|
||||||
module = dict(
|
module = dict(
|
||||||
|
@ -162,7 +161,7 @@ class Sysrc(StateModuleHelper):
|
||||||
|
|
||||||
(rc, out, err) = self.module.run_command(cmd)
|
(rc, out, err) = self.module.run_command(cmd)
|
||||||
if "Permission denied" in err:
|
if "Permission denied" in err:
|
||||||
raise OSError("Permission denied for %s" % self.path)
|
raise OSError(errno.EACCES, "Permission denied for %s" % self.path)
|
||||||
|
|
||||||
return (rc, out, err)
|
return (rc, out, err)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue