Exemplo n.º 1
0
 def export_uninstallComponent( self, system, component ):
   """ Remove runit directory for the specified component
       It implies unsetupComponent
   """
   return InstallTools.uninstallComponent( system, component )
Exemplo n.º 2
0
if len( result[ 'Value' ] ) < 1:
  gLogger.error( 'Given component does not exist' )
  DIRACexit( 1 )
if len( result[ 'Value' ] ) > 1:
  gLogger.error( 'Too many components match' )
  DIRACexit( 1 )

removeLogs = False
if force:
  removeLogs = True
else:
  if result[ 'Value' ][0][ 'Component' ][ 'Type' ] in InstallTools.COMPONENT_TYPES:
    result = promptUser( 'Remove logs?', [ 'y', 'n' ], 'n' )
    if result[ 'OK' ]:
      removeLogs = result[ 'Value' ] == 'y'
    else:
      gLogger.error( result[ 'Message' ] )
      DIRACexit( 1 )

result = InstallTools.uninstallComponent( system, component, removeLogs )
if not result['OK']:
  gLogger.error( result[ 'Message' ] )
  DIRACexit( 1 )

result = MonitoringUtilities.monitorUninstallation( system, component )
if not result['OK']:
  gLogger.error( result[ 'Message' ] )
  DIRACexit( 1 )
gLogger.notice( 'Successfully uninstalled component %s/%s' % ( system, component ) )
DIRACexit()
 def export_uninstallComponent(self, system, component):
     """ Remove runit directory for the specified component
     It implies unsetupComponent
 """
     return InstallTools.uninstallComponent(system, component)
    gLogger.error('Given component does not exist')
    DIRACexit(1)
if len(result['Value']) > 1:
    gLogger.error('Too many components match')
    DIRACexit(1)

removeLogs = False
if force:
    removeLogs = True
else:
    if result['Value'][0]['Component']['Type'] in InstallTools.COMPONENT_TYPES:
        result = promptUser('Remove logs?', ['y', 'n'], 'n')
        if result['OK']:
            removeLogs = result['Value'] == 'y'
        else:
            gLogger.error(result['Message'])
            DIRACexit(1)

result = InstallTools.uninstallComponent(system, component, removeLogs)
if not result['OK']:
    gLogger.error(result['Message'])
    DIRACexit(1)

result = MonitoringUtilities.monitorUninstallation(system, component)
if not result['OK']:
    gLogger.error(result['Message'])
    DIRACexit(1)
gLogger.notice('Successfully uninstalled component %s/%s' %
               (system, component))
DIRACexit()