def examples_remoteOperations( roListLoadFiles, roExpectListLoadFiles, ): ####+END: """.""" def cpsInit(): return collections.OrderedDict() #def menuItem(verbosity): icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity=verbosity) # 'little' or 'none' def execLineEx(cmndStr): icm.ex_gExecMenuItem(execLine=cmndStr) icm.cmndExampleMenuChapter('/Remote Operation Scenario Files/ *roListInv*') if roListLoadFiles: loadOpScenariosArgs="" for each in roListLoadFiles: loadOpScenariosArgs="""{loadOpScenariosArgs} --load {each}""".format( loadOpScenariosArgs=loadOpScenariosArgs, each=each,) thisCmndAction= " -i roListInv" icm.cmndExampleMenuItem(format(loadOpScenariosArgs + thisCmndAction), verbosity='none') if roExpectListLoadFiles: loadOpScenariosArgs="" for each in roExpectListLoadFiles: loadOpScenariosArgs="""{loadOpScenariosArgs} --load {each}""".format( loadOpScenariosArgs=loadOpScenariosArgs, each=each,) thisCmndAction= " -i roListExpectations" icm.cmndExampleMenuItem(format(loadOpScenariosArgs + thisCmndAction), verbosity='none')
def examples_pkgInfoPars(): """ ** Auxiliary examples to be commonly used. """ icm.cmndExampleMenuChapter('* =FP Values= pkgInfo Parameters') cmndAction = " -i inMailAcctParsGet" ; cmndArgs = "" menuLine = """{cmndAction} {cmndArgs}""".format(cmndAction=cmndAction, cmndArgs=cmndArgs) icm.cmndExampleMenuItem(menuLine, verbosity='none') menuLine = """""" icm.cmndExampleMenuItem(menuLine, icmName="pkgManage.py", verbosity='none')
def targetParamListCommonExamples( loadTargetArgs="", loadParamsArgs="", ): """ """ icm.cmndExampleMenuChapter( '*Common: TargetList And ParameterList and TICMO (Output) Information*' ) icm.cmndExampleMenuSection( 'targetsAccessListShow -- Based on targetsAccessListGet') thisCmndAction = " -i empna.targetsAccessListShow" icm.cmndExampleMenuItem(format(loadTargetArgs + thisCmndAction), verbosity='none') thisCmndAction = " -i empna.targetsAccessListGet" icm.cmndExampleMenuItem(format(loadTargetArgs + thisCmndAction), verbosity='none') icm.cmndExampleMenuSection( 'targetParametersListShow -- Based on targetParametersListGet') thisCmndAction = " -i empna.targetParamsListShow" icm.cmndExampleMenuItem(format(loadTargetArgs + loadParamsArgs + thisCmndAction), comment="# Targets List + T_Params List", verbosity='none') thisCmndAction = " -i empna.targetParamsListGet" icm.cmndExampleMenuItem(format(loadTargetArgs + loadParamsArgs + thisCmndAction), verbosity='none') icm.cmndExampleMenuSection( """TICMO: Target Path Base -- Give A Target's DN, Produce its Path Base""" ) thisCmndAction = " -i empna.targetBaseGet" targetSpecOptions = " --collective int --district libreCenter --targetType bxp --targetId localhost" icm.cmndExampleMenuItem(format(loadTargetArgs + targetSpecOptions + thisCmndAction), verbosity='none')
def cmnd( self, interactive=False, # Can also be called non-interactively ): cmndOutcome = self.getOpOutcome() if interactive: if not self.cmndLineValidate(outcome=cmndOutcome): return cmndOutcome callParamsDict = {} if not icm.cmndCallParamsValidate( callParamsDict, interactive, outcome=cmndOutcome): return cmndOutcome ####+END: def cpsInit(): return collections.OrderedDict() def menuItem(): icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='little') def execLineEx(cmndStr): icm.ex_gExecMenuItem(execLine=cmndStr) icmsPkgInfoBaseDir = gossonotPkgThis.pkgBase_baseDir() #print icmsPkgInfoBaseDir logControler = icm.LOG_Control() logControler.loggerSetLevel(20) icm.icmExampleMyName(G.icmMyName(), G.icmMyFullName()) icm.G_commonBriefExamples() bleep.examples_icmBasic() ####+BEGIN: bx:icm:python:cmnd:subSection :title "Dev And Testing" """ ** [[elisp:(beginning-of-buffer)][Top]] ================ [[elisp:(blee:ppmm:org-mode-toggle)][Nat]] [[elisp:(delete-other-windows)][(1)]] *Dev And Testing* [[elisp:(org-cycle)][| ]] [[elisp:(org-show-subtree)][|=]] """ ####+END: icm.cmndExampleMenuChapter('*General Dev and Testing CMNDs*') cmndName = "unitTest" cmndArgs = "" cps = collections.OrderedDict() # cps['icmsPkgName'] = icmsPkgName icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='little') icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='full') ####+BEGIN: bx:icm:python:cmnd:subSection :title "Simplified Targets Selection" """ ** [[elisp:(beginning-of-buffer)][Top]] ================ [[elisp:(blee:ppmm:org-mode-toggle)][Nat]] [[elisp:(delete-other-windows)][(1)]] *Simplified Targets Selection* [[elisp:(org-cycle)][| ]] [[elisp:(org-show-subtree)][|=]] """ ####+END: icm.cmndExampleMenuChapter('*Simplified Targets Selection*') # execLineEx("""ln -s /de/bx/current/district/librecenter/tiimi/targets/bxp/tList/ts-librecenter-localhostIcm.py liTargets.py""") # execLineEx("""ln -s /de/bx/current/district/librecenter/tiimi/targets/bxp/paramList/bxpUsageParamsIcm.py liParams.py""") execLineEx( """ln -s {pkgBaseDir}/ts-librecenter-localhostIcm.py liTargets.py""" .format(pkgBaseDir=icmsPkgInfoBaseDir)) execLineEx( """ln -s {pkgBaseDir}/bxpUsageParamsIcm.py liParams.py""".format( pkgBaseDir=icmsPkgInfoBaseDir)) execLineEx( """stress --cpu 2 --io 1 --vm 1 --vm-bytes 128M --timeout 10s --verbose""" ) loadTargetArgs = """ --load ./liTargets.py""" loadParamsArgs = """ --load ./liParams.py """ #ticmoFullInfo=format(commonArgs + loadTargetArgs) toIcm.targetParamSelectCommonExamples() toIcm.targetParamListCommonExamples(loadTargetArgs=loadTargetArgs, loadParamsArgs=loadParamsArgs) #fileParamPath1 = "/de/bx/coll/libreCenter/platforms/bue/0015/params/access/cur/" #fileParamPath2 = "/de/bx/coll/libreCenter/platforms/bue/0015/params/access/cur/" ####+BEGIN: bx:icm:python:cmnd:subSection :title "Run With Targets" """ ** [[elisp:(beginning-of-buffer)][Top]] ================ [[elisp:(blee:ppmm:org-mode-toggle)][Nat]] [[elisp:(delete-other-windows)][(1)]] *Run With Targets* [[elisp:(org-cycle)][| ]] [[elisp:(org-show-subtree)][|=]] """ ####+END: icm.cmndExampleMenuChapter( '/TOICM: Monitor/ *targetsParamsToIcmMonitor*') thisCmndAction = " -i linuxUsageKpisRetrieve" # accessParams = " --targetFqdn " + thisTargetFqdn + " --userName " + thisUser + " --password " + thisPassword # icm.cmndExampleMenuItem(format(toIcmMonitorArgs + accessParams + thisCmndAction), # verbosity='none') icm.cmndExampleMenuItem(format(loadTargetArgs + loadParamsArgs + thisCmndAction), verbosity='none') icm.cmndExampleMenuItem(format(loadTargetArgs + loadParamsArgs + thisCmndAction), verbosity='full')
def cmnd( self, interactive=False, # Can also be called non-interactively ): cmndOutcome = self.getOpOutcome() if interactive: if not self.cmndLineValidate(outcome=cmndOutcome): return cmndOutcome callParamsDict = {} if not icm.cmndCallParamsValidate( callParamsDict, interactive, outcome=cmndOutcome): return cmndOutcome ####+END: def cpsInit(): return collections.OrderedDict() def menuItem(): icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='little') def execLineEx(cmndStr): icm.ex_gExecMenuItem(execLine=cmndStr) logControler = icm.LOG_Control() logControler.loggerSetLevel(20) icm.icmExampleMyName(G.icmMyName(), G.icmMyFullName()) icm.G_commonBriefExamples() bleep.examples_icmBasic() ####+BEGIN: bx:icm:python:cmnd:subSection :title "Dev And Testing" """ ** [[elisp:(beginning-of-buffer)][Top]] ================ [[elisp:(blee:ppmm:org-mode-toggle)][Nat]] [[elisp:(delete-other-windows)][(1)]] *Dev And Testing* [[elisp:(org-cycle)][| ]] [[elisp:(org-show-subtree)][|=]] """ ####+END: icm.cmndExampleMenuChapter('*General Dev and Testing IIFs*') cmndName = "unitTest" cmndArgs = "" cps = cpsInit() # cps['icmsPkgName'] = icmsPkgName icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='little') icm.ex_gCmndMenuItem(cmndName, cps, cmndArgs, verbosity='full') icm.cmndExampleMenuChapter('*BinsPreps*') cmndAction = " -i binsPreps" cmndArgs = "" menuLine = """{cmndAction} {cmndArgs}""".format(cmndAction=cmndAction, cmndArgs=cmndArgs) icm.cmndExampleMenuItem(menuLine, verbosity='none') cmndAction = " -i binsPrepsCurInfo" cmndArgs = "" menuLine = """{cmndAction} {cmndArgs}""".format(cmndAction=cmndAction, cmndArgs=cmndArgs) icm.cmndExampleMenuItem(menuLine, verbosity='none') icm.cmndExampleMenuSection('*Install ICMs Needed Linux Packages*') cmndAction = " -i canon_linuxPkgInstall" cmndArgs = "" menuLine = """{cmndAction} {cmndArgs}""".format(cmndAction=cmndAction, cmndArgs=cmndArgs) icm.cmndExampleMenuItem(menuLine, verbosity='none') icm.cmndExampleMenuSection('*Install ICMs Needed Python Packages*') cmndAction = " -i canon_pythonPkgInstall" cmndArgs = "" menuLine = """{cmndAction} {cmndArgs}""".format(cmndAction=cmndAction, cmndArgs=cmndArgs) icm.cmndExampleMenuItem(menuLine, verbosity='none') # # ICMs PKG Information # icmsPkgInfoBaseDir = marmePkgThis.pkgBase_configDir() icmsPkgModuleBaseDir = marmePkgThis.pkgBase_baseDir() icmsPkgLib.examples_pkgInfoParsFull( icmsPkgNameSpecification(), icmsPkgInfoBaseDir=icmsPkgInfoBaseDir, icmsPkgModuleBaseDir=icmsPkgModuleBaseDir, icmsPkgControlBaseDir=icmsPkgControlBaseDirDefault(), icmsPkgRunBaseDir=icmsPkgRunBaseDirDefault(), )