Skip to content

Commit

Permalink
gate CRITICALCMD model in migration
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanmelt committed Oct 30, 2024
1 parent 7515002 commit dce0e1f
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ module OpenC3
class ScopeCriticalCmd < Migration
def self.run
ScopeModel.names.each do |scope|
scope_model = ScopeModel.get_model(name: scope)
parent = "#{scope}__SCOPEMULTI__#{scope}"
scope_model.deploy_critical_cmd_microservice("/notexist", {}, parent)
microservice_model = MicroserviceModel.get_model(name: parent, scope: scope)
microservice_model.cmd << "#{scope}__CRITICALCMD__#{scope}"
microservice_model.update
existing_model = MicroserviceModel.get_model(name: "#{scope}__CRITICALCMD__#{scope}")
if not existing_model
scope_model = ScopeModel.get_model(name: scope)
parent = "#{scope}__SCOPEMULTI__#{scope}"
scope_model.deploy_critical_cmd_microservice("/notexist", {}, parent)
microservice_model = MicroserviceModel.get_model(name: parent, scope: scope)
microservice_model.cmd << "#{scope}__CRITICALCMD__#{scope}"
microservice_model.update
end
end
end
end
Expand Down

0 comments on commit dce0e1f

Please sign in to comment.