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
[]
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
- To call the zhmclient to activate the lpar, Sleep for 10 minutes
- ssh to the ipaddress (Linux guest ip address)
- download the script file to, local machine, from given source path
- upload the dowloaded script file to the dir(/ffdc/u/eATS_automation) on the ssh session
- invoke the script command (ex: sh make_loop.sh) on the ssh session
- 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file linux_workload_execution-1.0.11.tar.gz.
File metadata
- Download URL: linux_workload_execution-1.0.11.tar.gz
- Upload date:
- Size: 6.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74cc1907ef40784ef96e82def1db79b6c05e8e8002c3b9bf43beff24c986389f
|
|
| MD5 |
c8e3afaa2703ff64ee00d28584c5eb2f
|
|
| BLAKE2b-256 |
facd0176dc02078dd637d09612640b13b6932306d1e2e3766486c95355133d08
|
File details
Details for the file linux_workload_execution-1.0.11-py3-none-any.whl.
File metadata
- Download URL: linux_workload_execution-1.0.11-py3-none-any.whl
- Upload date:
- Size: 8.1 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da60777ab56942742dc93b09718523c72ce8b11e12c61687dcac1dfdb6c7d864
|
|
| MD5 |
e1198ddc69084edd69f748b0e1711f2f
|
|
| BLAKE2b-256 |
129af2f89f867e57933524440f132dc4b2c878ea9ccf936727adaf79e7148895
|