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.10.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.10-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for linux_workload_execution-1.0.10.tar.gz
Algorithm Hash digest
SHA256 b465e7c73d477a049bff0cc3ebdd64e69474eeecade794057163568e2d3fc9a9
MD5 a34352afaa4c9470830d882d2daf667d
BLAKE2b-256 de41c21da312dc90e57b3ff646ab8a203eef7515d074519b0b4f93561f0b34e7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for linux_workload_execution-1.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 8b2db5030e592895eb848cac29b3951e6b43bc3aac0df844b89ed0c6d6ccd3d2
MD5 35342194684dd7f1aa7e1916b791b6f1
BLAKE2b-256 b8e87a39dc604c65e53bebd392a1b940271e07166623ee0c6810ddbfb5812b15

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