Skip to content

Commit 03d2d4d

Browse files
authored
core,node,server: improve graphman reassign response type
1 parent 4fbdf0b commit 03d2d4d

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

core/graphman/src/commands/deployment/reassign.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pub enum ReassignDeploymentError {
4949

5050
#[derive(Clone, Debug)]
5151
pub enum ReassignResult {
52-
EmptyResponse,
52+
Ok,
5353
CompletedWithWarnings(Vec<String>),
5454
}
5555

@@ -121,6 +121,6 @@ pub fn reassign_deployment(
121121
let warning_msg = format!("This is the only deployment assigned to '{}'. Please make sure that the node ID is spelled correctly.",node.as_str());
122122
Ok(ReassignResult::CompletedWithWarnings(vec![warning_msg]))
123123
} else {
124-
Ok(ReassignResult::EmptyResponse)
124+
Ok(ReassignResult::Ok)
125125
}
126126
}

node/src/manager/commands/deployment/reassign.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub fn run(
3636
)?;
3737

3838
match reassign_result {
39-
ReassignResult::EmptyResponse => {
39+
ReassignResult::Ok => {
4040
println!(
4141
"Deployment {} assigned to node {}",
4242
deployment.locator(),

server/graphman/src/resolvers/deployment_mutation.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub struct DeploymentMutation;
2727

2828
#[derive(Clone, Debug, Union)]
2929
pub enum ReassignResponse {
30-
EmptyResponse(EmptyResponse),
30+
Ok(EmptyResponse),
3131
CompletedWithWarnings(CompletedWithWarnings),
3232
}
3333

@@ -124,9 +124,7 @@ impl DeploymentMutation {
124124
ReassignResult::CompletedWithWarnings(warnings) => Ok(
125125
ReassignResponse::CompletedWithWarnings(CompletedWithWarnings::new(warnings)),
126126
),
127-
ReassignResult::EmptyResponse => {
128-
Ok(ReassignResponse::EmptyResponse(EmptyResponse::new()))
129-
}
127+
ReassignResult::Ok => Ok(ReassignResponse::Ok(EmptyResponse::new())),
130128
}
131129
}
132130
}

0 commit comments

Comments
 (0)