Skip to main content

linux_workload_execution is a Python package designed to take details like, lpar, ipaddress, script directory and script command as the input, and perform below activities

Project description

linux_workload_execution

[PyPI version]

Overview

linux_workload_execution is a Python package designed to: Takes details like, lpar, ipaddress, script directory and script command as the input, and perform below activities

  1. To call the zhmclient to activate the lpar, Sleep for 10 minutes
  2. ssh to the ipaddress (Linux guest ip address)
  3. download the script file to, local machine, from given source path
  4. upload the dowloaded script file to the dir(/ffdc/u/eATS_automation) on the ssh session
  5. invoke the script command (ex: sh make_loop.sh) on the ssh session
  6. collect the output printed on the ssh session and print it

Installation

You can install the package using pip:

pip install linux-workload-execution

config JSON format

config.json

{
    "hmc_host_name": "ip address of host",
    "hmc_userid": "hmc user id",
    "hmc_user_pwd": "hmc user password",    
    "cpc": "cpc details",
    "lpar": "lpar details",
    "linux_system_ip": "ip address of host system",
    "linux_user_name": "user name",
    "linux_pwd": "password",
    "script_details": {
        "token": "",
        "name": "example.sh",
        "url": "path to script file",
        "exec_path": "path to script execution",
        "local_path": "./"
    }
}

Usage example

main.py
*******
import sys
from linux_workload_execution.activation import Activation

if __name__ == "__main__":
    
    if (len(sys.argv) == 2 and os.path.exists(sys.argv[1])):
        activation_obj = Activation(sys.argv[1])
        if activation_obj.entry_point():
            print("***********Successfully completed***********")
        else:
            print("***********not successfully completed***********")
    else:
        print("***********JSON file not provided***********")
        print("***********Please provide JSON file***********")

Running the Python code

python main.py config.json

Python package creation

REFERENCE

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

linux_workload_execution-1.0.9.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

linux_workload_execution-1.0.9-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file linux_workload_execution-1.0.9.tar.gz.

File metadata

File hashes

Hashes for linux_workload_execution-1.0.9.tar.gz
Algorithm Hash digest
SHA256 8c01cd5d3fb70e5f4d01562cd45c0a3b7a57b9cb957bdaad9adac8c4df4967fc
MD5 495eaa6b37a52235c343579b116b9694
BLAKE2b-256 d4978d2f81499defcd643e9cd463b327bd3a22700e51720edbf2fe31189107e4

See more details on using hashes here.

File details

Details for the file linux_workload_execution-1.0.9-py3-none-any.whl.

File metadata

File hashes

Hashes for linux_workload_execution-1.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 1e10f064469ab1d77e4d85a2f480a2c251d9f2eb40f12d174ac9e97757c86b21
MD5 6747e17a47ed0991252351b9e6430789
BLAKE2b-256 f69dd8b84157a6226fceefd3fe781e0bbdd244e259e2d49f7863ccfa7718ceeb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page