Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(44)  |  Call(41)  |  Derive(0)  |  Import(3)

        def printError(msg, exitCode=1, exit=True):
    # TODO: Revisit this design; having exit in API is not good.
    err = '  [ERROR] %s' % msg
    if exit:
        raise SystemExit(err)
    else:
        LogUtil.error(msg)
        


src/s/t/stratuslab-client-14.03.0/stratuslab/Configurable.py   stratuslab-client(Download)
    def printError(self, msg):
        Util.printError(msg, exit=False)
 

src/s/t/stratuslab-client-14.03.0/stratuslab/image/Uploader.py   stratuslab-client(Download)
 
        if not os.path.exists(filename):
            Util.printError('Missing file: ' + filename, exit=True)
 
        ret = self._execute([compressionCmd, filename])
        if ret != 0:
            Util.printError('Error compressing file: %s' % compressedFilename, exit=True)

src/s/t/stratuslab-client-14.03.0/stratuslab/vm_manager/Runner.py   stratuslab-client(Download)
 
import stratuslab.Util as Util
from stratuslab.Util import printStep, printAction, printWarning, printError
import stratuslab.Exceptions as Exceptions
import stratuslab.cloudinit.Util as CloudInitUtil
            if self.instanceNumber > available:
                printError(
                    'disk cannot be attached; it is already mounted (%s/%s)' % (available, self.instanceNumber))
        except AttributeError:
            printError('Persistent disk service unavailable', exit=False)
            raise
        except Exception as e:
            printError(e, exit=False)
 
            if len(contextLine) < 2:
                printError('Error while parsing contextualization file.\n'
                           'Syntax error in line `%s`' % line)
 

src/s/t/stratuslab-client-14.03.0/stratuslab/Signator.py   stratuslab-client(Download)
    def sign(self):
        res, output = self._sign()
        if res:
            Util.printError(output, exit=False)
            self._cleanupTempFile()

src/s/t/stratuslab-client-14.03.0/stratuslab/CommandBase.py   stratuslab-client(Download)
    def raiseOrDisplayError(self, errorMsg):
        if self.verboseLevel > 2:
            raise
        else:
            Util.printError(errorMsg, exit=False)
    def printError(self, message):
        Util.printError(message, self)
 
    def printMandatoryOptionError(self, option):
        self.printError('Missing mandatory %s option' % option)

src/s/t/stratuslab-client-14.03.0/stratuslab/cloud/one.py   stratuslab-client(Download)
            return self.lcmStateDefintion[lcm]
        else:
            Util.printError('Invalid state: %s' % lcm, exit=False)
            return self.invalidState
 

src/s/t/stratuslab-client-14.03.0/stratuslab/volume_manager/volume_manager.py   stratuslab-client(Download)
 
from uuid import UUID
from stratuslab.Util import printError
from stratuslab.ConfigHolder import ConfigHolder
 
            return getfqdn(hostname)
        except Exception:
            printError('Unable to translate endpoint "%s" to an IP address' % hostname,
                       exit=False)
            return hostname

src/s/t/stratuslab-client-14.03.0/stratuslab/system/BaseSystem.py   stratuslab-client(Download)
    def startCloudSystem(self):
        self.stopService('oned')
        if self.startService('oned'):
            Util.printError("ONE failed to start")
        Util.printDetail('Waiting for ONE to finish starting')
        def getUidGidFromNode(user):
            rc, output = self._nodeShell(getUidGidCmd % user,
                                         withOutput=True)
            if rc != 0:
                Util.printError("Error getting '%s' user UID/GID from Node.\n%s" %
        def _extractUidGidFromGetentPasswdOutput(output):
            uid, gid = output.split(':')[2:4] # uid, gid
            if not all([uid, gid]):
                Util.printError("Error extracting '%s' user UID/GID from output.\n%s" %
                                    (user,output))
 
            if gidNode != gidLocal:
                Util.printError("Frontend user '%s' GID:%s doesn't match GID:%s on Node %s." %
                                 (gidLocal, user, gidNode, self.nodeAddr))
        else:
    def startLibvirt(self):
        rc, output = self.executeCmd('service libvirtd restart'.split(),
                                     withOutput=True)
        if rc != 0:
            Util.printError('Could not start libvirt.\n%s' % output)

src/s/t/stratuslab-client-14.03.0/stratuslab/Creator.py   stratuslab-client(Download)
    def _printError(self, msg):
        self._notifyOnError(msg)
        Util.printError(msg)
 
    def setListener(self, listener):

src/s/t/stratuslab-client-14.03.0/stratuslab/Cluster.py   stratuslab-client(Download)
import time
 
from stratuslab.Util import printStep, printAction, printError, printInfo, printDebug
 
 
            while not hostReady and not hostFailed:
                if not ssh.waitForConnectivity(host, vmStartTimeout):
                    printError('Timed out while connecting to %s.  Removing from target config. list.' % host.public_ip)
                    failedHosts.append(host)
                    hostFailed = True
                    self.hosts.remove(host)
            else:
                printError('Error instantiating some or all of the nodes. Bailing out...')
                if self.clean_after_failure:
                    self._runner.killInstances(self._runner.vmIds)

  1 | 2  Next