Beispiel #1
0
def enableApp(appName, fromCLI):  
  app = bundle_paths.get_bundle(appName)
  if None == app:
    raise cex.FilePath, "Application '%s' not found." % appName

  currEnabled = app.is_enabled()

  returnDict = {}
  if not currEnabled: # then enable it
    returnDict["restartRequired"] = True
    app.enable()

  if fromCLI:
    if currEnabled:
      logger.info("%s is already enabled." % appName)
    else:
      logger.info("%s enabled." % appName)
  return returnDict
Beispiel #2
0
def enableApp(appName, fromCLI):
    app = bundle_paths.get_bundle(appName)
    if None == app:
        raise cex.FilePath, "Application '%s' not found." % appName

    currEnabled = app.is_enabled()

    returnDict = {}
    if not currEnabled:  # then enable it
        returnDict["restartRequired"] = True
        app.enable()

    if fromCLI:
        if currEnabled:
            logger.info("%s is already enabled." % appName)
        else:
            logger.info("%s enabled." % appName)
    return returnDict
Beispiel #3
0
def localAppStatus(args, fromCLI):
  """
  Works only on the local filesystem.
  Shows whether app of given name is enabled
  """
  paramsReq = (ARG_APPNAME,)
  paramsOpt = ()
  comm.validateArgs(paramsReq, paramsOpt, args)

  returnDict = {}
  app = bundle_paths.get_bundle(args[ARG_APPNAME])
  if None == app:
    raise cex.FilePath, "Application '%s' not found." % args[ARG_APPNAME]
  currEnabled = app.is_enabled()

  if fromCLI:
    if currEnabled:
      logger.info("%s is enabled." % args[ARG_APPNAME])
    else:
      logger.info("%s is disabled." % args[ARG_APPNAME])
  return returnDict
Beispiel #4
0
def localAppStatus(args, fromCLI):
    """
  Works only on the local filesystem.
  Shows whether app of given name is enabled
  """
    paramsReq = (ARG_APPNAME, )
    paramsOpt = ()
    comm.validateArgs(paramsReq, paramsOpt, args)

    returnDict = {}
    app = bundle_paths.get_bundle(args[ARG_APPNAME])
    if None == app:
        raise cex.FilePath, "Application '%s' not found." % args[ARG_APPNAME]
    currEnabled = app.is_enabled()

    if fromCLI:
        if currEnabled:
            logger.info("%s is enabled." % args[ARG_APPNAME])
        else:
            logger.info("%s is disabled." % args[ARG_APPNAME])
    return returnDict
Beispiel #5
0
def localIsAppEnabled(appName):
  app = bundle_paths.get_bundle(appName)
  if None == app:
    raise cex.FilePath, "Application '%s' not found." % appName

  return app.is_enabled()
Beispiel #6
0
def localIsAppEnabled(appName):
    app = bundle_paths.get_bundle(appName)
    if None == app:
        raise cex.FilePath, "Application '%s' not found." % appName

    return app.is_enabled()