Skip to content

Commit

Permalink
Set scenarioStatus to ready when copied (#48)
Browse files Browse the repository at this point in the history
* tests for clusters option before using it

* uses _hasVms value inside GetStackstormVms

* sets scenarioStatus to ready when scenario is copied
  • Loading branch information
sei-awelle authored Dec 13, 2022
1 parent d7a453d commit 4e54346
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions Steamfitter.Api/Services/ScenarioService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ public ScenarioService(SteamfitterContext context,
newScenarioEntity.CreatedBy = _user.GetId();
newScenarioEntity.Name = $"{oldScenarioEntity.Name} - {_user.Claims.FirstOrDefault(c => c.Type == "name").Value}";
newScenarioEntity.OnDemand = true;
newScenarioEntity.Status = ScenarioStatus.ready;

_context.Scenarios.Add(newScenarioEntity);
await _context.SaveChangesAsync(ct);
Expand Down
5 changes: 5 additions & 0 deletions Steamfitter.Api/Services/StackStormService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ public async STT.Task GetStackstormVms()
var apiParameters = _options.ApiParameters;
try
{
if (!_hasVms)
{
return;
}

var clusters = apiParameters["clusters"].ToString().Split(",");
var vmListResult = await _stackStormConnector.VSphere.GetVmsWithUuid(clusters);
// add VM's to _vmList
Expand Down

0 comments on commit 4e54346

Please sign in to comment.