summaryrefslogtreecommitdiff
path: root/lib/hyperstack/cli.rb
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-05-25 21:09:23 +0300
committerPaul Buetow <paul@buetow.org>2026-05-25 21:09:23 +0300
commit2aa71022ad2d9379cf38db522194f38c05115d26 (patch)
treeedd4c1e06fc262084349d942b12111ad35f30770 /lib/hyperstack/cli.rb
parent4fd86fbc75670878308fd6a56b7778334b52ccd8 (diff)
refactor(manager): move dry-run/resume logic into VmLifecycle; thin Manager facade
- Manager is now a thin facade (~160 lines) that delegates VM lifecycle, provisioning, testing, and cleanup to focused collaborators. - Moved replace/resume/dry-run handling and presentation helpers from Manager into VmLifecycle where they belong. - Fixed operator-precedence bug: instance && instance['id']. - Fixed status fallback to return public_ip from state on API error. - Fixed LocalWireGuard delegation bug (removed @local_wireguard.show_local_wireguard call which did not exist; now routes through Manager#show_local_wireguard). - Removed dead code: unused ensure_security_rules and legacy_litellm from VmLifecycle. - ProvisioningOrchestrator: removed spurious show_local_wireguard call and added legacy_litellm_rules cleanup with proper warn_out helper. - Added missing require statements (json, fileutils, provisioning). - Removed dead attr_reader :config from InferenceTester. - Renamed shadowed variable in cleanup_local_access.
Diffstat (limited to 'lib/hyperstack/cli.rb')
-rw-r--r--lib/hyperstack/cli.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/hyperstack/cli.rb b/lib/hyperstack/cli.rb
index 76f158e..b5bcaff 100644
--- a/lib/hyperstack/cli.rb
+++ b/lib/hyperstack/cli.rb
@@ -1,5 +1,6 @@
# frozen_string_literal: true
+require 'json'
require 'optparse'
require 'socket'
@@ -383,9 +384,9 @@ module HyperstackVM
hostnames = loaders.map { |loader| loader.config.wireguard_gateway_hostname }
begin
local_manager = build_manager(loaders.first.config, out: local_wg_out)
- cleanup = local_manager.send(:cleanup_local_access, dry_run: dry_run, hostnames: hostnames,
+ cleanup = local_manager.cleanup_local_access(dry_run: dry_run, hostnames: hostnames,
allowed_ips: allowed_ips)
- local_manager.send(:report_local_cleanup, local_wg_out, cleanup, dry_run: dry_run)
+ local_manager.report_local_cleanup(local_wg_out, cleanup, dry_run: dry_run)
rescue Error => e
errors[:local_wireguard] = e.message
end