Beispiel #1
0
# Initializing Arguments
###############################

with open("omsdktest\\idrac.info", "r") as enum_data:
    _argsinfo = json.load(enum_data)

ipaddr = _get_args('ipaddr')
driver = _get_optional('driver')
uname = _get_optional('user.name')
upass = _get_optional('user.password', '')
pref = _get_optional('protocol', 'WSMAN')
nshare = _get_optional('share')
nsharename = _get_optional('share.user.name')
nsharepass = _get_optional('share.user.password', '')
image = _get_optional('image', '')
creds = ProtocolCredentialsFactory()
if uname :
    creds.add(UserCredentials(uname, upass))

@property
def not_implemented():
    print("===== not implemented ====")


if platform.system() == "Windows":
    liason_share = FileOnShare(remote =nshare,
        mount_point='Z:\\', isFolder=True,
        creds = UserCredentials(nsharename, nsharepass))
else:
    liason_share = FileOnShare(remote =nshare,
        mount_point='/tst', isFolder=True,
Beispiel #2
0
import sys, os
import platform
import json
import time
sys.path.append(os.getcwd())

counter = 1
from omsdk.sdkcreds import UserCredentials, ProtocolCredentialsFactory
from omsdk.sdkprint import PrettyPrint
from omsdk.sdkinfra import sdkinfra
import logging

logger = logging.getLogger(__name__)
#logging.basicConfig(level=logging.DEBUG)

creds = ProtocolCredentialsFactory()
creds.add(UserCredentials("root", "calvin"))
ipaddr = "100.96.25.119"

sd = sdkinfra()
sd.importPath()

cmc = sd.get_driver(sd.driver_enum.CMC, ipaddr, creds)
if cmc is None:
    print("Error: Not found a device driver for: " + ipaddr)
    exit()
else:
    print("Connected to " + ipaddr)

idrac_ips = cmc.get_idrac_ips()
print(PrettyPrint.prettify_json(cmc.get_json_device()["ComputeModule"]))