Skip to content

Commit

Permalink
no docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
damoore044 committed May 30, 2024
1 parent 22a1651 commit eefac8c
Showing 1 changed file with 1 addition and 77 deletions.
78 changes: 1 addition & 77 deletions robottelo/host_helpers/api_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -723,83 +723,7 @@ def register_host_and_needed_setup(
force=False,
loc=None,
):
"""
Helper will setup desired entities to host content. Then, register the
host client to the entities, using associated activation-key.
Attempt to make needed associations between detached entities.
Add desired repos to the content-view prior to calling this helper.
Or, add them to content-view after calling, then publish/promote.
The host will be registered to location: None (visible to all locations).
Parameters:
client : instance
An instance of a RHEL content host to register.
enable_repos : bool, optional
Enable all available repos on the client after registration? Default is False.
Be sure to enable any repo(s) for the client after calling this method.
rex_key : bool, optional
Add a Remote Execution Key to the client for satellite? Default is False.
force : bool, optional
Force registration of the client to bypass? Default is False.
A reused fixture content host will fail if already registered.
loc : object, optional
Pass a location object to limit host visibility. Default is None,
making the client available to all locations.
The following arguments can be any of the following types:
- int: pass the id of the entity to be read
- str: pass the name of the entity to be searched
- entity: pass an entity instance
organization : int, str, or entity
Pass an Organization instance, name, or id to use.
activation_key : int, str, or entity
Pass an Activation-Key instance, name, or id.
environment : int, str, or entity
Pass a Lifecycle-Environment instance, name, or id.
Example: can pass string name 'Library'.
content_view : int, str, or entity
Pass a Content-View instance, name, or id.
Example: can pass string name 'Default Organization View'.
Notes:
1. Will fail if passed entities do not exist in the same organization and satellite.
2. Use param `enable_repos` to try enabling any repositories on the client
that were added to the content-view prior. But if there are no
repositories added/made available, this will fail.
3. The 'Default Organization View' cannot be published, promoted, edited, or deleted,
but you can register the client to it.
Steps:
1. Get needed entities from arguments (id, name, or instance). Read all as instance.
2. Publish the content-view if no versions exist or needs_publish.
3. Promote the newest content-view-version if not in the environment already. Skip for 'Library'.
4. Assign environment and content-view to the activation-key if not associated.
5. If desired, enable all repositories from content-view for activation-key.
6. Register the host using the activation-key associated with the content.
7. Add a rex_key to the client if desired.
Returns: dict
If succeeded:
{
'result': 'success',
'client': client,
'organization': entities['Organization'],
'activation_key': entities['ActivationKey'],
'environment': entities['LifecycleEnvironment'],
'content_view': entities['ContentView'],
}
If failed:
{
'result': 'error',
'client': None, unless registration was successful,
'message': Details of the failure encountered,
}
"""
# docstrings will be written in a future commit

method_error = {
'result': 'error',
Expand Down

0 comments on commit eefac8c

Please sign in to comment.