Skip to content

Commit

Permalink
Add simulate safeguard to ticket creation
Browse files Browse the repository at this point in the history
Also fixed a bug in the remove_osd code where it
was using the wrong block_utils fn.  It was trying to
get the /dev/device on a /dev/device instead of the
mountpoint like it should be.
  • Loading branch information
cholcombe973 committed Sep 20, 2017
1 parent eb67aa9 commit 405b318
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/backend/ceph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ impl CephBackend {
fn remove_osd(&self, dev_path: &Path, simulate: bool) -> Result<(), String> {
//If the OSD is still running we can query its version. If not then we
//should ask either another OSD or a monitor.
let mount_point = match block_utils::get_mount_device(&dev_path).map_err(
let mount_point = match block_utils::get_mountpoint(&dev_path).map_err(
|e| e.to_string(),
)? {
Some(osd_path) => osd_path,
Expand Down
26 changes: 14 additions & 12 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,20 @@ Details: Disk {} as failed. Please replace if necessary",
simulate,
)
.map_err(|e| e.to_string())?;
let _ = create_support_ticket(
&config.jira_host,
&config.jira_user,
&config.jira_password,
&config.jira_issue_type,
&config.jira_priority,
&config.jira_project_id,
&config.jira_ticket_assignee,
"Dead disk",
&description,
&environment,
).map_err(|e| format!("{:?}", e))?;
if !simulate {
let _ = create_support_ticket(
&config.jira_host,
&config.jira_user,
&config.jira_password,
&config.jira_issue_type,
&config.jira_priority,
&config.jira_project_id,
&config.jira_ticket_assignee,
"Dead disk",
&description,
&environment,
).map_err(|e| format!("{:?}", e))?;
}
}
}
Err(e) => {
Expand Down

0 comments on commit 405b318

Please sign in to comment.