cloudmesh.management.script

A convenient method to execute shell commands and return their output. Note: that this method requires that the command be completely executed before the output is returned. For many activities in cloudmesh this is sufficient.

Module Contents

Classes

SystemPath

Managing the System path in the .bashrc or .bash_profile files

Script

Executing a script defined by a simple text parameter

Functions

find_process(name)

find a process by name

class cloudmesh.management.script.SystemPath

Bases: object

Managing the System path in the .bashrc or .bash_profile files

static add(path)

Adds a path to the ~/.bashrc or ~/.bash_profile files.

TODO: Windows is not implemented yet.

Parameters

path – The path to be added

Returns

class cloudmesh.management.script.Script

Bases: object

Executing a script defined by a simple text parameter

static run(script, live=False, debug=False)

run the specified script line by line.

TODO: at one point this should be moved to cloudmesh.common

Parameters
  • script – The script

  • debug – If true the output of the script is printed

Returns

cloudmesh.management.script.find_process(name)

find a process by name

Parameters

name – the name of the process

Returns

A list of dicts in which the attributes pid, command, and created are available and the name matches the specified name argument.

TODO: at one point this should be moved to cloudmesh.common

Return a list of processes matching ‘name’.