def clean_locks():
 LCK = 'removed'
 out = {LCK: 0}
 if (not os.path.exists('/etc/zypp/locks')):
  return out
 for node in __zypper__.xml.call('cl').getElementsByTagName('message'):
  text = node.childNodes[0].nodeValue.lower()
  if text.startswith(LCK):
   out[LCK] = text.split(' ')[1]
   break
 return out

def clean_locks ( ) : LCK = 'removed' out = { LCK : 0 } if ( not os . path . exists ( '/etc/zypp/locks' ) ) : return out for node in __zypper__ . xml . call ( 'cl' ) . getElementsByTagName ( 'message' ) : text = node . childNodes [ 0 ] . nodeValue . lower ( ) if text . startswith ( LCK ) : out [ LCK ] = text . split ( ' ' ) [ 1 ] break return out
remove unused locks that do not currently lock any package .