properly disable no_autostart for Gaggle
@@ -2327,6 +2327,19 @@ impl GooseAttack {
let mut value = false;
// Currently Gaggles are not Controller-aware.
+ if self.configuration.no_autostart {
+ key = "--no-autostart";
+ value = true;
+ // Otherwise set default if configured.
+ } else if let Some(default_no_autostart) = self.defaults.no_autostart {
+ key = "set_default(GooseDefault::NoAutoStart)";
+ value = default_no_autostart;
+
+ self.configuration.no_autostart = default_no_autostart;
+ }
+
+ if self.configuration.no_autostart {
+ // Can't disable autostart in Gaggle mode.
if [AttackMode::Manager, AttackMode::Worker].contains(&self.attack_mode) {
return Err(GooseError::InvalidOption {
option: key.to_string(),
@@ -2336,28 +2349,17 @@ impl GooseAttack {
key
),
});
- } else if self.configuration.no_autostart {
- key = "--no-autostart";
- value = true;
- // Otherwise set default if configured.
- } else if let Some(default_no_autostart) = self.defaults.no_autostart {
- key = "set_default(GooseDefault::NoAutoStart)";
- value = default_no_autostart;
-
- self.configuration.no_autostart = default_no_autostart;
}
// Can't disable autostart if there's no Controller enabled.
- if self.configuration.no_autostart
- && self.configuration.no_telnet
- && self.configuration.no_websocket
- {
+ if self.configuration.no_telnet && self.configuration.no_websocket {
return Err(GooseError::InvalidOption {
option: key.to_string(),
value: value.to_string(),
detail: format!("{} can not be set together with both the --no-telnet and --no-websocket flags.", key),
});
}
+ }
Ok(())
}
