Skip to content

Commit

Permalink
ifreload: more diagnostic messages (bnc#882311)
Browse files Browse the repository at this point in the history
  • Loading branch information
wipawel committed Jul 14, 2014
1 parent a554da5 commit 0123b17
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
27 changes: 21 additions & 6 deletions client/ifreload.c
Expand Up @@ -225,12 +225,18 @@ ni_do_ifreload(int argc, char **argv)

/* skip unused devices without config */
if (!ni_ifcheck_worker_config_exists(w) &&
!ni_ifcheck_device_configured(dev))
!ni_ifcheck_device_configured(dev)) {
ni_info("skipping %s interface: no configuration exists and"
"device is not configured by wicked", w->name);
continue;
}

/* skip if config changed somehow */
if (ni_ifcheck_worker_config_matches(w))
/* skip if config has not been changed */
if (ni_ifcheck_worker_config_matches(w)) {
ni_info("skipping %s interface: "
"configuration unchanged", w->name);
continue;
}

/* Mark persistend when requested */
if (opt_persistent)
Expand All @@ -240,17 +246,26 @@ ni_do_ifreload(int argc, char **argv)
ni_ifworker_array_append(&marked, w);

/* Do not ifdown non-existing device */
if (!dev)
if (!dev) {
ni_info("skipping ifdown operation for %s interface: "
"non-existing device", w->name);
continue;
}

/* Persistent do not go down but up only */
if (ni_ifcheck_device_is_persistent(dev))
if (ni_ifcheck_device_is_persistent(dev)) {
ni_info("skipping ifdown operation for %s interface: "
"persistent device", w->name);
continue;
}

/* Decide how much down we go */
if (ni_ifcheck_worker_config_exists(w)) {
if (!ni_ifcheck_device_configured(dev))
if (!ni_ifcheck_device_configured(dev)) {
ni_info("skipping ifdown operation for %s interface: "
"device is not configured by wicked", w->name);
continue;
}
w->target_range.min = NI_FSM_STATE_NONE;
w->target_range.max = NI_FSM_STATE_DEVICE_READY;
nmarked++;
Expand Down
2 changes: 1 addition & 1 deletion src/fsm.c
Expand Up @@ -1985,7 +1985,7 @@ ni_fsm_get_matching_workers(ni_fsm_t *fsm, ni_ifmatcher_t *match, ni_ifworker_ar
/* skipping ifworkers of interfaces not configured in the past */
if (ni_string_empty(w->config.origin) && match->require_configured) {
ni_info("skipping %s interface: "
"not configured yet", w->name);
"device is not configured by wicked yet", w->name);
continue;
}
/* skipping ifworkers of interfaces in the persistent mode */
Expand Down

0 comments on commit 0123b17

Please sign in to comment.