@ -233,7 +233,7 @@ class AnsibleModule(object):
seuser = params . get ( ' seuser ' , None )
seuser = params . get ( ' seuser ' , None )
serole = params . get ( ' serole ' , None )
serole = params . get ( ' serole ' , None )
setype = params . get ( ' setype ' , None )
setype = params . get ( ' setype ' , None )
selevel = params . get ( ' se range' , ' s0 ' )
selevel = params . get ( ' se level' , None )
secontext = [ seuser , serole , setype ]
secontext = [ seuser , serole , setype ]
if self . selinux_mls_enabled ( ) :
if self . selinux_mls_enabled ( ) :
@ -309,7 +309,9 @@ class AnsibleModule(object):
return context
return context
if ret [ 0 ] == - 1 :
if ret [ 0 ] == - 1 :
return context
return context
context = ret [ 1 ] . split ( ' : ' )
# Limit split to 4 because the selevel, the last in the list,
# may contain ':' characters
context = ret [ 1 ] . split ( ' : ' , 3 )
return context
return context
def selinux_context ( self , path ) :
def selinux_context ( self , path ) :
@ -325,7 +327,9 @@ class AnsibleModule(object):
self . fail_json ( path = path , msg = ' failed to retrieve selinux context ' )
self . fail_json ( path = path , msg = ' failed to retrieve selinux context ' )
if ret [ 0 ] == - 1 :
if ret [ 0 ] == - 1 :
return context
return context
context = ret [ 1 ] . split ( ' : ' )
# Limit split to 4 because the selevel, the last in the list,
# may contain ':' characters
context = ret [ 1 ] . split ( ' : ' , 3 )
return context
return context
def user_and_group ( self , filename ) :
def user_and_group ( self , filename ) :