Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove unused DebugPromise

  • Loading branch information...
commit 7b008e564465d53511ed00f66bb78dff661f45fd 1 parent a56b147
@sigurdteigen sigurdteigen authored
Showing with 0 additions and 77 deletions.
  1. +0 −76 src/promises.c
  2. +0 −1  src/promises.h
View
76 src/promises.c
@@ -360,82 +360,6 @@ Promise *ExpandDeRefPromise(char *scopeid, Promise *pp)
return pcopy;
}
-void DebugPromise(Promise *pp)
-{
- Constraint *cp;
- Body *bp;
- FnCall *fp;
- Rlist *rp;
- Rval retval;
-
- Policy *policy = PolicyFromPromise(pp);
-
- GetVariable("control_common", "version", &retval);
-
- if (pp->promisee.item != NULL)
- {
- fprintf(stdout, "%s promise by \'%s\' -> ", pp->agentsubtype, pp->promiser);
- ShowRval(stdout, pp->promisee);
- fprintf(stdout, " if context is %s\n", pp->classes);
- }
- else
- {
- fprintf(stdout, "%s promise by \'%s\' (implicit) if context is %s\n", pp->agentsubtype, pp->promiser,
- pp->classes);
- }
-
- fprintf(stdout, "in bundle %s of type %s\n", pp->bundle, pp->bundletype);
-
- for (cp = pp->conlist; cp != NULL; cp = cp->next)
- {
- fprintf(stdout, "%10s => ", cp->lval);
-
- switch (cp->rval.rtype)
- {
- case CF_SCALAR:
- if ((bp = IsBody(policy->bodies, (char *) cp->rval.item)))
- {
- ShowBody(bp, 15);
- }
- else
- {
- ShowRval(stdout, cp->rval); /* literal */
- }
- printf("\n");
- break;
-
- case CF_LIST:
-
- rp = (Rlist *) cp->rval.item;
- ShowRlist(stdout, rp);
- printf("\n");
- break;
-
- case CF_FNCALL:
- fp = (FnCall *) cp->rval.item;
-
- if ((bp = IsBody(policy->bodies, fp->name)))
- {
- ShowBody(bp, 15);
- }
- else
- {
- ShowRval(stdout, cp->rval); /* literal */
- }
- break;
-
- default:
- printf("Unknown RHS type %c\n", cp->rval.rtype);
- }
-
- if (cp->rval.rtype != CF_FNCALL)
- {
- fprintf(stdout, " if body context %s\n", cp->classes);
- }
-
- }
-}
-
/*******************************************************************/
Body *IsBody(Body *list, char *key)
View
1  src/promises.h
@@ -37,6 +37,5 @@ void DeletePromises(Promise *pp);
void PromiseRef(enum cfreport level, Promise *pp);
Promise *NewPromise(char *typename, char *promiser);
void HashPromise(char *salt, Promise *pp, unsigned char digest[EVP_MAX_MD_SIZE + 1], enum cfhashes type);
-void DebugPromise(Promise *pp);
#endif
Please sign in to comment.
Something went wrong with that request. Please try again.