@ -522,13 +522,12 @@ class LinuxService(Service):
def get_systemd_status_dict ( self ) :
def get_systemd_status_dict ( self ) :
# Check status first as show will not fail if service does not exist
# Check status first as show will not fail if service does not exist
( rc , out , err ) = self . execute_command ( " %s status ' %s ' " % ( self . enable_cmd , self . __systemd_unit , ) )
if rc != 0 :
self . module . fail_json ( msg = ' failure %d running systemctl status for %r : %s ' % ( rc , self . __systemd_unit , err ) )
( rc , out , err ) = self . execute_command ( " %s show ' %s ' " % ( self . enable_cmd , self . __systemd_unit , ) )
( rc , out , err ) = self . execute_command ( " %s show ' %s ' " % ( self . enable_cmd , self . __systemd_unit , ) )
if rc != 0 :
if rc != 0 :
self . module . fail_json ( msg = ' failure %d running systemctl show for %r : %s ' % ( rc , self . __systemd_unit , err ) )
self . module . fail_json ( msg = ' failure %d running systemctl show for %r : %s ' % ( rc , self . __systemd_unit , err ) )
elif ' LoadState=not-found ' in out :
self . module . fail_json ( msg = ' systemd could not find the requested service " %r " : %s ' % ( self . __systemd_unit , err ) )
key = None
key = None
value_buffer = [ ]
value_buffer = [ ]
status_dict = { }
status_dict = { }