Sha256: eabf0802900c55398bfe1ea1ed4617aa561c0527952e2bf0a99acd96b7b90a96

Contents?: true

Size: 659 Bytes

Versions: 2

Compression:

Stored size: 659 Bytes

Contents

import { propsToCamelCase } from 'foremanReact/common/helpers';

export const REMOTE_EXECUTION = 'remoteExecution';
export const KATELLO_AGENT = 'katelloAgent';

const defaultRemoteActionMethod = ({ hostDetails }) => {
  const {
    content_facet_attributes: contentFacetAttributes,
  } = hostDetails;
  const contentFacet = propsToCamelCase(contentFacetAttributes ?? {});
  const katelloAgentAvailable = (contentFacet.katelloAgentInstalled &&
    contentFacet.katelloAgentEnabled);
  if (contentFacet.remoteExecutionByDefault || !katelloAgentAvailable) {
    return REMOTE_EXECUTION;
  }
  return KATELLO_AGENT;
};

export default defaultRemoteActionMethod;

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
katello-4.4.0.rc2 webpack/components/extensions/HostDetails/hostDetailsHelpers.js
katello-4.4.0.rc1 webpack/components/extensions/HostDetails/hostDetailsHelpers.js