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

All Samples(10)  |  Call(8)  |  Derive(0)  |  Import(2)

        def filePutContent(filename, data, neverShowData=True):
    _printDetail('Creating file %s with content: \n%s\n' % (filename,
                                                            (neverShowData and '' or data)))
    if isinstance(data, unicode):
        fh = codecs.open(filename, 'w', 'utf8')
    else:
        fh = open(filename, 'wb')
    fh.write(data)
    fh.close()
        


src/s/t/stratuslab-client-14.03.0/stratuslab/system/BaseSystem.py   stratuslab-client(Download)
from stratuslab import Exceptions
from stratuslab import Defaults
from stratuslab.Util import appendOrReplaceInFile, execute, fileAppendContent, \
    fileGetContent, filePutContent, scp, sshCmd
import stratuslab.Util as Util
        _,output = self.executeCmdWithOutput(['iptables-save'])
        Util.printDetail('Saving firewall rules to %s.' % filename)
        filePutContent(filename, output)
        os.chmod(filename, 0600)
 
        confFile = self.getPackageConfigFileName('dhcp')
 
        Util.filePutContent(confFile, content)
 
    def __getIpMacTuplesForNetworkType(self, _type):
    def _writeToFilesRemote(self, listOfFileNameContentTuples):
        tmpFilename = tempfile.mktemp()
        for remoteFilename, content in listOfFileNameContentTuples:
            Util.filePutContent(tmpFilename, content)
            self._nodeCopy(tmpFilename, remoteFilename)

src/s/t/stratuslab-client-14.03.0/stratuslab/ManifestInfo.py   stratuslab-client(Download)
                                             self.arch, self.type,
                                             self.version, Util.manifestExt)
        Util.filePutContent(filename, manifestText)
        Util.printDetail("Manifest: %s" % filename, self.verboseLevel,
                         Util.VERBOSE_LEVEL_DETAILED)

src/s/t/stratuslab-client-14.03.0/stratuslab/system/centos.py   stratuslab-client(Download)
                filename = self.extraRepos[repo]['filename']
                content = self.extraRepos[repo]['content']
                Util.filePutContent(filename, content)
            else:
                Util.printError("Repository '%s' is not defined in the extra list of repositories (%s)." % \
NETMASK=%s
""" % (device, ip, netmask)
        Util.filePutContent(deviceConf, data)
 
    def _persistRemoteBridgeConfig(self, iface, bridge):

src/s/t/stratuslab-client-14.03.0/stratuslab/volume_manager/PersistentDisk.py   stratuslab-client(Download)
        headers, content = self._getGzip(volumeUrl)
        self._raiseOnErrors(headers, content)
        Util.filePutContent(filename, content, True)
 
    def uploadVolume(self, filename):

src/s/t/stratuslab-client-14.03.0/stratuslab/Testor.py   stratuslab-client(Download)
from stratuslab.volume_manager.volume_manager_factory import VolumeManagerFactory
from stratuslab.vm_manager.vm_manager_factory import VmManagerFactory
from stratuslab.Util import sleep, filePutContent
from stratuslab.Util import printStep, printInfo, printWarning
from stratuslab.image.Image import Image
                self.fail('Error mounting downloaded image, corrupted?')
 
            filePutContent(localTestFile, testString)
 
            fileEquals = self._compareLocalFiles(localTestFile, testFile % localMountPoint)