Skip to content

Commit

Permalink
Fix replace by node target (#677)
Browse files Browse the repository at this point in the history
  • Loading branch information
LittleChimera authored Jul 31, 2024
1 parent 8f6e681 commit 14ad1fd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion rs/cli/src/commands/subnet/replace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl ExecutableCommand for Replace {
.with_target(subnet_target)
.membership_replace(
!self.no_heal,
self.motivation.clone().unwrap_or_default(),
self.motivation.clone(),
self.optimize,
self.exclude.clone().into(),
self.only.clone(),
Expand Down
10 changes: 7 additions & 3 deletions rs/cli/src/subnet_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,20 @@ impl SubnetManager {
pub async fn membership_replace(
&self,
heal: bool,
motivation: String,
motivation: Option<String>,
optimize: Option<usize>,
exclude: Option<Vec<String>>,
only: Vec<String>,
include: Option<Vec<PrincipalId>>,
min_nakamoto_coefficients: Option<MinNakamotoCoefficients>,
) -> anyhow::Result<SubnetChangeResponse> {
let subnet_query_by = self.get_subnet_query_by(self.target()?).await?;
let mut motivations: Vec<String> = vec![motivation];
let mut to_be_replaced: Vec<DecentralizedNode> = vec![];
let mut motivations: Vec<String> = if let Some(motivation) = motivation { vec![motivation] } else { vec![] };
let mut to_be_replaced: Vec<DecentralizedNode> = if let SubnetQueryBy::NodeList(nodes) = &subnet_query_by {
nodes.clone()
} else {
vec![]
};

let subnet_change_request = self
.registry_instance
Expand Down

0 comments on commit 14ad1fd

Please sign in to comment.