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.15.z] Setting sanity hostname attr initially #15355

Merged

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 requested a review from a team as a code owner June 6, 2024 16:49
@Satellite-QE Satellite-QE added 6.15.z Introduced in or relating directly to Satellite 6.15 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: 7314
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman -m build_sanity -k test_satellite_installation --external-logging
Test Result : ======== 1 failed, 5442 deselected, 5450 warnings in 1162.00s (0:19:21) ========

@Satellite-QE Satellite-QE added the PRT-Failed Indicates that latest PRT run is failed for the PR label Jun 6, 2024
@jyejare
Copy link
Member

jyejare commented Jun 6, 2024

The PRT failed but is not related to this PR, it's a product failure, hence merging.

@jyejare jyejare added PRT-Passed Indicates that latest PRT run is passed for the PR and removed PRT-Failed Indicates that latest PRT run is failed for the PR labels Jun 6, 2024
@jyejare jyejare enabled auto-merge (squash) June 6, 2024 17:34
@jyejare jyejare merged commit d51de05 into 6.15.z Jun 6, 2024
17 of 22 checks passed
@jyejare jyejare deleted the cherry-pick-6.15.z-956ccf2cf27858da467689e309cdff815f4bde2f branch June 6, 2024 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.15.z Introduced in or relating directly to Satellite 6.15 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