Functions

Common functions

iceprod.core.functions.uncompress(infile, out_dir=None)[source]

Uncompress a file, if possible

iceprod.core.functions.compress(infile, compression='lzma')[source]

Compress a file or directory. The compression argument is used as the new file extension

iceprod.core.functions.iscompressed(infile)[source]

Check if a file is a compressed file, based on file name

iceprod.core.functions.istarred(infile)[source]

Check if a file is a tarred file, based on file name

iceprod.core.functions.cksm(filename, type, buffersize=16384, file=True)[source]

Return checksum of file using algorithm specified

iceprod.core.functions.md5sum(filename, buffersize=16384)[source]

Return md5 digest of file

iceprod.core.functions.sha1sum(filename, buffersize=16384)[source]

Return sha1 digest of file

iceprod.core.functions.sha256sum(filename, buffersize=16384)[source]

Return sha256 digest of file

iceprod.core.functions.sha512sum(filename, buffersize=16384)[source]

Return sha512 digest of file

iceprod.core.functions.load_cksm(sumfile, base_filename)[source]

Load the checksum from a file

iceprod.core.functions.check_cksm(file, type, sum)[source]

Check a checksum of a file

iceprod.core.functions.check_md5sum(file, sum)[source]

Check an md5sum of a file

iceprod.core.functions.check_sha1sum(file, sum)[source]

Check an sha1sum of a file

iceprod.core.functions.check_sha256sum(file, sum)[source]

Check an sha256sum of a file

iceprod.core.functions.check_sha512sum(file, sum)[source]

Check an sha512sum of a file

iceprod.core.functions.removedirs(path)[source]
iceprod.core.functions.copy(src, dest)[source]
iceprod.core.functions.getInterfaces()[source]

Get a list of available interfaces.

Requires psutil.

Returns:

{type: address}}

Return type:

dict of {nic_name

iceprod.core.functions.get_local_ip_address()[source]

Get the local (loopback) ip address

iceprod.core.functions.gethostname()[source]

Get hostname of this computer.

async iceprod.core.functions.download(url, local, options={})[source]

Download a file, checksumming if possible

async iceprod.core.functions.upload(local, url, checksum=True, options={})[source]

Upload a file, checksumming if possible

iceprod.core.functions.delete(url, options={})[source]

Delete a url or file

iceprod.core.functions.isurl(url)[source]

Determine if this is a supported protocol