aboutsummaryrefslogtreecommitdiff
path: root/lib/cfm.c
diff options
context:
space:
mode:
authorEthan Jackson <ethan@nicira.com>2012-02-14 20:53:59 -0800
committerEthan Jackson <ethan@nicira.com>2012-02-21 00:02:20 -0800
commitbde9f75de100e3801735bf69f605320f4db65cba (patch)
tree136cb7844551f64173f256cbace160f428cfaf54 /lib/cfm.c
parentd35f8e72cdcfa7b99e1987bb17b7bc1035ce2213 (diff)
unixctl: New JSON RPC back-end.
The unixctl library had used the vde2 management protocol since the early days of Open vSwitch. As Open vSwitch has matured, several Python daemons have been added to the code base which would benefit from a unixctl implementations. Instead of implementing the old unixctl protocol in Python, this patch changes unixctl to use JSON RPC for which we already have an implementation in both Python and C. Future patches will need to implement a unixctl library in Python on top of JSON RPC. Signed-off-by: Ethan Jackson <ethan@nicira.com>
Diffstat (limited to 'lib/cfm.c')
-rw-r--r--lib/cfm.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/cfm.c b/lib/cfm.c
index d373f422..8d90829a 100644
--- a/lib/cfm.c
+++ b/lib/cfm.c
@@ -677,7 +677,7 @@ cfm_unixctl_show(struct unixctl_conn *conn, int argc, const char *argv[],
if (argc > 1) {
cfm = cfm_find(argv[1]);
if (!cfm) {
- unixctl_command_reply(conn, 501, "no such CFM object");
+ unixctl_command_reply_error(conn, "no such CFM object");
return;
}
cfm_print_details(&ds, cfm);
@@ -687,7 +687,7 @@ cfm_unixctl_show(struct unixctl_conn *conn, int argc, const char *argv[],
}
}
- unixctl_command_reply(conn, 200, ds_cstr(&ds));
+ unixctl_command_reply(conn, ds_cstr(&ds));
ds_destroy(&ds);
}
@@ -706,14 +706,14 @@ cfm_unixctl_set_fault(struct unixctl_conn *conn, int argc, const char *argv[],
} else if (!strcasecmp("normal", fault_str)) {
fault_override = -1;
} else {
- unixctl_command_reply(conn, 501, "unknown fault string");
+ unixctl_command_reply_error(conn, "unknown fault string");
return;
}
if (argc > 2) {
cfm = cfm_find(argv[1]);
if (!cfm) {
- unixctl_command_reply(conn, 501, "no such CFM object");
+ unixctl_command_reply_error(conn, "no such CFM object");
return;
}
cfm->fault_override = fault_override;
@@ -723,5 +723,5 @@ cfm_unixctl_set_fault(struct unixctl_conn *conn, int argc, const char *argv[],
}
}
- unixctl_command_reply(conn, 200, "OK");
+ unixctl_command_reply(conn, "OK");
}