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

[6.13.z] Setting sanity hostname attr initially #15354

Conversation

Satellite-QE
Copy link
Collaborator

Cherrypick of PR: #15350

Problem Statement

Sanity is failing with server.hostname attribute not found. Earlier the dynaconf validator was setting it as a default value and attribute but that Is removed in PR #15340.

Solution

Setting the hostname attribute to server for sanity.

Local Testing

In [2]: settings.server.hostname
---------------------------------------------------------------------------
BoxKeyError                               Traceback (most recent call last)
Cell In[2], line 1
----> 1 settings.server.hostname

File ~/venv/robottelo312/src/dynaconf/dynaconf/utils/boxing.py:18, in evaluate_lazy_format.<locals>.evaluate(dynabox, item, *args, **kwargs)
     16 @wraps(f)
     17 def evaluate(dynabox, item, *args, **kwargs):
---> 18     value = f(dynabox, item, *args, **kwargs)
     19     settings = dynabox._box_config["box_settings"]
     21     if getattr(value, "_dynaconf_lazy_format", None):

File ~/venv/robottelo312/src/dynaconf/dynaconf/utils/boxing.py:41, in DynaBox.__getattr__(self, item, *args, **kwargs)
     39 except (AttributeError, KeyError):
     40     n_item = find_the_correct_casing(item, self) or item
---> 41     return super().__getattr__(n_item, *args, **kwargs)

File ~/venv/robottelo312/src/dynaconf/dynaconf/vendor/box/box.py:360, in Box.__getattr__(self, item)
    358     if self._box_config['default_box']:
    359         return self.__get_default(item)
--> 360     raise BoxKeyError(str(err)) from None
    361 return value

BoxKeyError: "'DynaBox' object has no attribute 'hostname'"

In [3]: settings.set("server.hostname", None)

In [4]: type(settings.server.hostname)
NoneType

@Satellite-QE Satellite-QE added 6.13.z Introduced in or relating directly to Satellite 6.13 Auto_Cherry_Picked Automatically cherrypicked PR using GHA No-CherryPick PR doesnt need CherryPick to previous branches labels Jun 6, 2024
@Satellite-QE
Copy link
Collaborator Author

trigger: test-robottelo
pytest: tests/foreman -m build_sanity -k test_satellite_installation

@omkarkhatavkar omkarkhatavkar added the AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing label Jun 6, 2024
@Satellite-QE
Copy link
Collaborator Author

PRT Result

Build Number: 7315
Build Status: SUCCESS
PRT Comment: pytest tests/foreman -m build_sanity -k test_satellite_installation --external-logging
Test Result : ======== 1 passed, 5299 deselected, 5308 warnings in 1323.31s (0:22:03) ========

@Satellite-QE Satellite-QE added the PRT-Passed Indicates that latest PRT run is passed for the PR label Jun 6, 2024
@Satellite-QE Satellite-QE merged commit b6dc520 into 6.13.z Jun 6, 2024
17 of 18 checks passed
@Satellite-QE Satellite-QE deleted the cherry-pick-6.13.z-956ccf2cf27858da467689e309cdff815f4bde2f branch June 6, 2024 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.13.z Introduced in or relating directly to Satellite 6.13 Auto_Cherry_Picked Automatically cherrypicked PR using GHA AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing No-CherryPick PR doesnt need CherryPick to previous branches PRT-Passed Indicates that latest PRT run is passed for the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants