You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

linux-workload-execution

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

linux-workload-execution

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

1.0.11
pipPyPI
Maintainers
2

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

  • 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

REFERENCE

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts