Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No CaseComponent is set when empty configuration is given #57

Closed
da-ekchajzer opened this issue Feb 17, 2022 · 0 comments
Closed

No CaseComponent is set when empty configuration is given #57

da-ekchajzer opened this issue Feb 17, 2022 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@da-ekchajzer
Copy link
Collaborator

Bug description

When an empty configuration server is given default case is not set

To Reproduce

POST /v1/server/

{}

**No CASE component in verbose object **

"verbose": {
"CPU-1": {
      "unit": 2,
      "core_units": 24,
      "die_size_per_core": 0.245,
      "impacts": {
        "gwp": 44,
        "pe": 650,
        "adp": 0.04
      }
    },
    "SSD-1": {
      "unit": 1,
      "capacity": 1000,
      "density": 48.5,
      "impacts": {
        "gwp": 52,
        "pe": 640,
        "adp": 0.002
      }
    },
    "RAM-1": {
      "unit": 24,
      "capacity": 32,
      "density": 0.625,
      "impacts": {
        "gwp": 2832,
        "pe": 35328,
        "adp": 0.12
      }
    },
    "POWER_SUPPLY-1": {
      "unit": 2,
      "unit_weight": 2.99,
      "impacts": {
        "gwp": 146,
        "pe": 2104,
        "adp": 0.05
      }
    },
    "MOTHERBOARD-1": {
      "unit": 1,
      "impacts": {
        "gwp": 66,
        "pe": 836,
        "adp": 0.004
      }
    },
    "ASSEMBLY-1": {
      "unit": 1,
      "impacts": {
        "gwp": 7,
        "pe": 69,
        "adp": 0
      }
    }
}

Expected behavior

If no configuration is given, a default CaseComponent should be added

JSON OUTPUT

"verbose": {
"CPU-1": {
      "unit": 2,
      "core_units": 24,
      "die_size_per_core": 0.245,
      "impacts": {
        "gwp": 44,
        "pe": 650,
        "adp": 0.04
      }
    },
    "SSD-1": {
      "unit": 1,
      "capacity": 1000,
      "density": 48.5,
      "impacts": {
        "gwp": 52,
        "pe": 640,
        "adp": 0.002
      }
    },
    "RAM-1": {
      "unit": 24,
      "capacity": 32,
      "density": 0.625,
      "impacts": {
        "gwp": 2832,
        "pe": 35328,
        "adp": 0.12
      }
    },
    "POWER_SUPPLY-1": {
      "unit": 2,
      "unit_weight": 2.99,
      "impacts": {
        "gwp": 146,
        "pe": 2104,
        "adp": 0.05
      }
    },
    "MOTHERBOARD-1": {
      "unit": 1,
      "impacts": {
        "gwp": 66,
        "pe": 836,
        "adp": 0.004
      }
    },
    "ASSEMBLY-1": {
      "unit": 1,
      "impacts": {
        "gwp": 7,
        "pe": 69,
        "adp": 0
      }
    },
    "CASE-1": {
      "unit": 1,
      "case_type": "used_value": "rack",
      "impacts": {
        "gwp": 150,
        "pe": 2200,
        "adp": 0.02
      }
}

Additional context

Add an empty ComponentCase into the default server configuration in model/devices.py line 142 get_default_configuration_component_list

@da-ekchajzer da-ekchajzer added the bug Something isn't working label Feb 17, 2022
@da-ekchajzer da-ekchajzer self-assigned this Feb 17, 2022
@da-ekchajzer da-ekchajzer changed the title No case is set when empty configuration is given No CaseComponent is set when empty configuration is given Feb 17, 2022
da-ekchajzer pushed a commit that referenced this issue Feb 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant