Primarily for puppet-unity use.

        Update the iSCSI and FC initiators if needed.
12297
def update_initiators(self, iqns=None, wwns=None):
        
        # First get current iqns
        iqns = set(iqns) if iqns else set()
        current_iqns = set()
        if self.iscsi_host_initiators:
            current_iqns = {initiator.initiator_id
                            for initiator in self.iscsi_host_initiators}
        # Then get current wwns
        wwns = set(wwns) if wwns else set()
        current_wwns = set()
        if self.fc_host_initiators:
            current_wwns = {initiator.initiator_id
                            for initiator in self.fc_host_initiators}
        updater = UnityHostInitiatorUpdater(
            self, current_iqns | current_wwns, iqns | wwns)
        return updater.update()
271608
protected void update(CmsUUID structureId, String rootPath, int type, CmsResourceState state) {

        if (!isContainerConfiguration(rootPath, type)) {
            return;
        }
        m_updateSet.add(structureId);
    }
348529
def run(configobj=None):
    
    acscteforwardmodel(configobj['input'],
                       exec_path=configobj['exec_path'],
                       time_stamps=configobj['time_stamps'],
                       verbose=configobj['verbose'],
                       quiet=configobj['quiet'],
                       single_core=configobj['single_core']
                       )
757825
def importPuppetClasses(self, smartProxyId):
        
        return self.api.create('{}/{}/import_puppetclasses'
                               .format(self.objName, smartProxyId), '{}')
715855
def initialize_fsm(self):
        
        self.fabric_fsm = {
            fw_const.INIT_STATE:
                [self.init_state, self.init_state],
            fw_const.OS_IN_NETWORK_STATE:
                [self.create_os_in_nwk, self.delete_os_in_nwk],
            fw_const.OS_OUT_NETWORK_STATE:
                [self.create_os_out_nwk, self.delete_os_out_nwk],
            fw_const.OS_DUMMY_RTR_STATE:
                [self.create_os_dummy_rtr, self.delete_os_dummy_rtr],
            fw_const.DCNM_IN_NETWORK_STATE:
                [self.create_dcnm_in_nwk, self.delete_dcnm_in_nwk],
            fw_const.DCNM_IN_PART_UPDATE_STATE:
                [self.update_dcnm_in_part, self.clear_dcnm_in_part],
            fw_const.DCNM_OUT_PART_STATE:
                [self.create_dcnm_out_part, self.delete_dcnm_out_part],
            fw_const.DCNM_OUT_NETWORK_STATE:
                [self.create_dcnm_out_nwk, self.delete_dcnm_out_nwk],
            fw_const.DCNM_OUT_PART_UPDATE_STATE:
                [self.update_dcnm_out_part, self.clear_dcnm_out_part],
            fw_const.FABRIC_PREPARE_DONE_STATE:
                [self.prepare_fabric_done, self.prepare_fabric_done]}
36133
def in_bolt_compiler
      r = Puppet::Pal.in_tmp_environment('bolt', modulepath: @modulepath, facts: {}) do |pal|
        pal.with_script_compiler do |compiler|
          alias_types(compiler)
          begin
            Puppet.override(yaml_plan_instantiator: Bolt::PAL::YamlPlan::Loader) do
              yield compiler
            end
          rescue Bolt::Error => e
            e
          rescue Puppet::PreformattedError => e
            PALError.from_preformatted_error(e)
          rescue StandardError => e
            PALError.from_preformatted_error(e)
          end
        end
      end

      # Plans may return PuppetError but nothing should be throwing them
      if r.is_a?(StandardError) && !r.is_a?(Bolt::PuppetError)
        raise r
      end
      r
    end
514852
def update(self):
        
        con = self.subpars.pars.control
        self(con.eqi1*con.tind)
453783
def run_facter(self, key=None):
        """"""
        args = [self.facter_path]
        #this seems to not cause problems, but leaving it separate
        args.append("--puppet")
        if self.external_dir is not None:
            args.append('--external-dir')
            args.append(self.external_dir)
        if self.uses_yaml:
            args.append("--yaml")
        if key is not None:
            args.append(key)
        proc = subprocess.Popen(args, stdout=subprocess.PIPE)
        results = proc.stdout.read()
        if self.uses_yaml:
            parsed_results = yaml.load(results)
            if key is not None:
                return parsed_results[key]
            else:
                return parsed_results
        results = results.decode()
        if key is not None:
            return results.strip()
        else:
            return dict(_parse_cli_facter_results(results))
1316673
def apply
      started_at = DateTime.now.to_s
      # Check if a Puppetfile is neccesary for use/not use librarian-puppet
      check_puppetfile_content
      # Copy static modules that are not downloaded by librarian-puppet
      copy_static_modules
      # Apply step and if the process is succesful create the checkpoint.
      process_status = apply_step
      create_step_checkpoint(started_at) if process_status.success?
      process_status
    end
112117
void updateAgentConfigurationFile(
			TargetHandlerParameters parameters,
			SSHClient ssh,
			File tmpDir,
			Map<String,String> keyToNewValue )
	throws IOException {

		this.logger.fine( "Updating agent parameters on remote host..." );

		// Update the agent's configuration file
		String agentConfigDir = Utils.getValue( parameters.getTargetProperties(), SCP_AGENT_CONFIG_DIR, DEFAULT_SCP_AGENT_CONFIG_DIR );
		File localAgentConfig = new File( tmpDir, Constants.KARAF_CFG_FILE_AGENT );
		File remoteAgentConfig = new File( agentConfigDir, Constants.KARAF_CFG_FILE_AGENT );

		// Download remote agent config file...
		ssh.newSCPFileTransfer().download(remoteAgentConfig.getCanonicalPath(), new FileSystemFile(tmpDir));

		// Replace "parameters" property to point on the user data file...
		String config = Utils.readFileContent(localAgentConfig);
		config = Utils.updateProperties( config, keyToNewValue );
		Utils.writeStringInto(config, localAgentConfig);

		// Then upload agent config file back
		ssh.newSCPFileTransfer().upload(new FileSystemFile(localAgentConfig), agentConfigDir);
	}
1101242
def agent(state, host, server=None, port=None):
    

    args = []

    if server:
        args.append('--server=%s' % server)
    if port:
        args.append('--masterport=%s' % port)

    yield 'puppet agent -t %s' % ' '.join(args)
699690
def update_if_client(fctn):
    """"""
    @functools.wraps(fctn)
    def _update_if_client(self, *args, **kwargs):
        b = self._bundle
        if b is None or not hasattr(b, 'is_client'):
            return fctn(self, *args, **kwargs)
        elif b.is_client and \
                (b._last_client_update is None or
                (datetime.now() - b._last_client_update).seconds > 1):

            b.client_update()
        return fctn(self, *args, **kwargs)
    return _update_if_client
498409
def run(self):
        '''  '''

        # Announce versions
        self.versions()

        # Sample/Tag info and Help
        self.tags()
        print '\n%s' % self.workbench.help('cli')

        # Now that we have the Workbench connection spun up, we register some stuff
        # with the embedded IPython interpreter and than spin it up
        # cfg = IPython.config.loader.Config()
        cfg = Config()
        cfg.InteractiveShellEmbed.autocall = 2
        cfg.InteractiveShellEmbed.colors = 'Linux'
        cfg.InteractiveShellEmbed.color_info = True
        cfg.InteractiveShellEmbed.autoindent = True
        cfg.InteractiveShellEmbed.deep_reload = True
        cfg.PromptManager.in_template = (
            r'{color.LightPurple}{short_md5}{color.Yellow}{prompt_deco}{color.LightBlue} Workbench{color.Green}[\#]> ')
        # cfg.PromptManager.out_template = ''

        # Create the IPython shell
        self.ipshell = IPython.terminal.embed.InteractiveShellEmbed(
            config=cfg, banner1='', exit_msg='\nWorkbench has SuperCowPowers...')

        # Register our transformer, the shell will use this for 'shortcut' commands
        auto_quoter = auto_quote_xform.AutoQuoteTransformer(self.ipshell, self.ipshell.prefilter_manager)
        auto_quoter.register_command_set(self.command_set)

        # Setting up some Pandas options
        pd.set_option('display.width', 140)
        pd.set_option('max_colwidth', 15)

        # Start up the shell with our set of workbench commands
        self.ipshell(local_ns=self.command_dict)
1137120
def _add_flow_v1_2(self, src, port, timeout, datapath):
        """"""
        ofproto = datapath.ofproto
        parser = datapath.ofproto_parser

        match = parser.OFPMatch(
            in_port=port, eth_src=src, eth_type=ether.ETH_TYPE_SLOW)
        actions = [parser.OFPActionOutput(
            ofproto.OFPP_CONTROLLER, ofproto.OFPCML_MAX)]
        inst = [parser.OFPInstructionActions(
            ofproto.OFPIT_APPLY_ACTIONS, actions)]
        mod = parser.OFPFlowMod(
            datapath=datapath, command=ofproto.OFPFC_ADD,
            idle_timeout=timeout, priority=65535,
            flags=ofproto.OFPFF_SEND_FLOW_REM, match=match,
            instructions=inst)
        datapath.send_msg(mod)
868785
@FFDCIgnore({ InvalidBundleContextException.class, LaunchException.class })
    protected void innerLaunchFramework(boolean isClient) {
        try {
            // Register services
            registerInstrumentationService(systemBundleCtx);
            registerLibertyProcessService(systemBundleCtx, config);
            preRegisterMBeanServerPipelineService(systemBundleCtx);
            openThreadIdentityTracker(systemBundleCtx);
            registerPauseableComponentController(systemBundleCtx);

            // Initialize the repo registry: we can use caches AND logging for messages
            BundleRepositoryRegistry.initializeDefaults(config.getProcessName(), true, isClient);

            Provisioner provisioner = new ProvisionerImpl();
            provisioner.initialProvisioning(systemBundleCtx, config);

            // All of our kernel provisioning activities are complete!
            config.getKernelResolver().dispose();
        } catch (LaunchException le) {
            // this is one of ours, no need to wrap again, just rethrow
            throw le;
        } catch (InvalidBundleContextException e) {
            // no-op: the framework was shutdown while bundles were being
            // installed -- things should stop gracefully w/ no ugly error
            // messages.
        }
    }
71746
def run_puppet(driver_instance, puppet_tests, logger:nil, reset_after_run:true)
      # use supplied logger in preference to the default puppetbox logger instance
      logger = logger || @logger
      logger.debug("#{driver_instance.node_name} running #{puppet_tests.size} tests")

      if driver_instance.open
        logger.debug("#{driver_instance.node_name} started")
        if driver_instance.self_test
          logger.debug("#{driver_instance.node_name} self_test OK, running puppet")
          puppet_tests.each { |test_name, puppet_code|
            if @result_set.class_size(driver_instance.node_name) > 0 and reset_after_run
              # purge and reboot the vm - this will save approximately 1 second
              # per class on the self-test which we now know will succeed
              driver_instance.reset
            end
            setup_test(driver_instance, test_name)
            logger.info("running test #{driver_instance.node_name} - #{test_name}")

            # write out the local test file
            relative_puppet_file = commit_testcase(
              puppet_tests, driver_instance.node_name, test_name
            )
            driver_instance.sync_testcase(driver_instance.node_name, test_name)

            puppet_file_remote = File.join(PUPPET_TESTCASE_DIR, relative_puppet_file)
            driver_instance.run_puppet_x2(puppet_file_remote)
            @logger.debug("Saved result #{driver_instance.node_name} #{test_name} #{driver_instance.result.passed?}")
            @result_set.save(driver_instance.node_name, test_name, driver_instance.result)

            Report::log_test_result_or_errors(
              @logger,
              driver_instance.node_name,
              test_name,
              driver_instance.result,
            )
          }
          logger.debug("#{driver_instance.node_name} test completed, closing instance")
        else
          raise "#{driver_instance.node_name} self test failed, unable to continue"
        end
      else
        raise "#{driver_instance.node_name} failed to start, unable to continue"
      end

      driver_instance.close
    end
246847
def update(self):
        '''
        
        '''
        self.kSS = 1.0
        self.MSS = 1.0
        self.KtoLnow_init = self.kSS
        self.Rfunc = ConstantFunction(self.Rfree)
        self.wFunc = ConstantFunction(self.wRte)
        self.RfreeNow_init = self.Rfunc(self.kSS)
        self.wRteNow_init = self.wFunc(self.kSS)
        self.MaggNow_init = self.kSS
        self.AaggNow_init = self.kSS
        self.PermShkAggNow_init = 1.0
        self.TranShkAggNow_init = 1.0
        self.makeAggShkDstn()
        self.AFunc = ConstantFunction(1.0)