def _call_update_event()

in cookbooks/aws-parallelcluster-computefleet/files/clusterstatusmgtd/clusterstatusmgtd.py [0:0]


    def _call_update_event(self):
        try:
            compute_fleet_data = ComputeFleetStatus._transform_compute_fleet_data(  # pylint: disable=W0212
                self._compute_fleet_data
            )
            _write_json_to_file(self._config.computefleet_status_path, compute_fleet_data)
        except Exception as e:
            log.error("Update event handler failed during fleet status translation: %s", e)
            raise ClusterStatusManager.ClusterStatusUpdateEventError(e)

        cinc_log_file = "/var/log/chef-client.log"
        log.info("Calling update event handler, log can be found at %s", cinc_log_file)
        cmd = (
            "sudo cinc-client "
            "--local-mode "
            "--config /etc/chef/client.rb "
            "--log_level auto "
            f"--logfile {cinc_log_file} "
            "--force-formatter "
            "--no-color "
            "--chef-zero-port 8889 "
            "--json-attributes /etc/chef/dna.json "
            "--override-runlist aws-parallelcluster-entrypoints::update_computefleet_status"
        )
        try:
            # The command being passed has been built from string literals and local variables and can be trusted.
            _run_command(cmd, self._config.update_event_timeout_minutes)
        except Exception as e:
            log.error("Update event handler failed. Check log file %s", cinc_log_file)
            raise ClusterStatusManager.ClusterStatusUpdateEventError(e)