Sha256: 09d3f67fd1ea7ab0b57cb8cfb582f2264282416a9bd01a10926d5ce321d3aa7f
Contents?: true
Size: 959 Bytes
Versions: 8
Compression:
Stored size: 959 Bytes
Contents
import { propsToCamelCase } from 'foremanReact/common/helpers'; export const REMOTE_EXECUTION = 'remoteExecution'; export const KATELLO_AGENT = 'katelloAgent'; export 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 const hostIsNotRegistered = ({ hostDetails }) => { const { subscription_facet_attributes: subscriptionFacetAttributes, } = hostDetails; return !subscriptionFacetAttributes?.uuid; }; export const hostIsRegistered = ({ hostDetails }) => !hostIsNotRegistered({ hostDetails }); export default defaultRemoteActionMethod;
Version data entries
8 entries across 8 versions & 1 rubygems