Skip to content

Commit 8bf3d06

Browse files
authored
Merge pull request #5679 from victormlg/ENT-10078-add-cfedition-variable
Added default:sys.cf_edition variable
2 parents f23c912 + 81a56e8 commit 8bf3d06

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

libpromises/generic_agent.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1591,7 +1591,17 @@ void GenericAgentInitialize(EvalContext *ctx, GenericAgentConfig *config)
15911591

15921592
EvalContextClassPutHard(ctx, "any", "source=agent");
15931593

1594-
GenericAgentAddEditionClasses(ctx);
1594+
GenericAgentAddEditionClasses(ctx); // May set "enterprise_edition" class
1595+
1596+
const Class *enterprise_edition = EvalContextClassGet(ctx, "default", "enterprise_edition");
1597+
if (enterprise_edition == NULL)
1598+
{
1599+
EvalContextVariablePutSpecial(ctx, SPECIAL_SCOPE_SYS, "cf_edition", "community", CF_DATA_TYPE_STRING, "derived-from=enterprise_edition,report");
1600+
}
1601+
else
1602+
{
1603+
EvalContextVariablePutSpecial(ctx, SPECIAL_SCOPE_SYS, "cf_edition", "enterprise", CF_DATA_TYPE_STRING, "derived-from=enterprise_edition,report");
1604+
}
15951605

15961606
/* Make sure the chroot for recording changes this process would normally
15971607
* make on the system is setup if that was requested. */

0 commit comments

Comments
 (0)