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 os
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.11.tar.gz (6.7 MB 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.11-py3-none-any.whl (8.1 MB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for linux_workload_execution-1.0.11.tar.gz
Algorithm Hash digest
SHA256 74cc1907ef40784ef96e82def1db79b6c05e8e8002c3b9bf43beff24c986389f
MD5 c8e3afaa2703ff64ee00d28584c5eb2f
BLAKE2b-256 facd0176dc02078dd637d09612640b13b6932306d1e2e3766486c95355133d08

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for linux_workload_execution-1.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 da60777ab56942742dc93b09718523c72ce8b11e12c61687dcac1dfdb6c7d864
MD5 e1198ddc69084edd69f748b0e1711f2f
BLAKE2b-256 129af2f89f867e57933524440f132dc4b2c878ea9ccf936727adaf79e7148895

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