def semanage_fcontext_delete(module, result, target, ftype, do_reload, sestore=''):
 changed = False
 prepared_diff = ''
 try:
  sefcontext = seobject.fcontextRecords(sestore)
  sefcontext.set_reload(do_reload)
  exists = semanage_fcontext_exists(sefcontext, target, ftype)
  if exists:
   (orig_seuser, orig_serole, orig_setype, orig_serange) = exists
   if (not module.check_mode):
    sefcontext.delete(target, ftype)
   changed = True
   if module._diff:
    prepared_diff += '# Deletion to semanage file context mappings\n'
    prepared_diff += ('-%s      %s      %s:%s:%s:%s\n' % (target, ftype, exists[0], exists[1], exists[2], exists[3]))
 except Exception:
  e = get_exception()
  module.fail_json(msg=('%s: %s\n' % (e.__class__.__name__, to_native(e))))
 if (module._diff and prepared_diff):
  result['diff'] = dict(prepared=prepared_diff)
 module.exit_json(changed=changed, **result)

def semanage_fcontext_delete ( module , result , target , ftype , do_reload , sestore = '' ) : changed = False prepared_diff = '' try : sefcontext = seobject . fcontextRecords ( sestore ) sefcontext . set_reload ( do_reload ) exists = semanage_fcontext_exists ( sefcontext , target , ftype ) if exists : ( orig_seuser , orig_serole , orig_setype , orig_serange ) = exists if ( not module . check_mode ) : sefcontext . delete ( target , ftype ) changed = True if module . _diff : prepared_diff += '# Deletion to semanage file context mappings\n' prepared_diff += ( '-%s      %s      %s:%s:%s:%s\n' % ( target , ftype , exists [ 0 ] , exists [ 1 ] , exists [ 2 ] , exists [ 3 ] ) ) except Exception : e = get_exception ( ) module . fail_json ( msg = ( '%s: %s\n' % ( e . __class__ . __name__ , to_native ( e ) ) ) ) if ( module . _diff and prepared_diff ) : result [ 'diff' ] = dict ( prepared = prepared_diff ) module . exit_json ( changed = changed , ** result )
delete selinux file context mapping definition from the policy .