robottelo.manifests

Manifest clonning tools..

Module Contents

Classes

ManifestCloner

Manifest clonning utility class.

Manifest

Class that holds the contents of a manifest with a generated filename

Functions

clone(org_environment_access=False, name='default')

Clone the cached manifest and return a Manifest object.

original_manifest(name='default')

Returns a Manifest object filed with the template manifest.

upload_manifest_locked(org_id, manifest=None, interface=INTERFACE_API, timeout=None)

Upload a manifest with locking, using the requested interface.

Attributes

_manifest_cloner

class robottelo.manifests.ManifestCloner(template=None, private_key=None, signing_key=None)

Manifest clonning utility class.

_download_manifest_info(self, name='default')

Download and cache the manifest information.

clone(self, org_environment_access=False, name='default')

Clones a RedHat-manifest file.

Change the consumer uuid and sign the new manifest with signing key. The certificate for the key must be installed on the candlepin server in order to accept uploading the cloned manifest.

Parameters
  • org_environment_access – Whether to modify consumer content access mode to org_environment (Golden ticket enabled manifest).

  • name – which manifest url to clone (named key-value pairs are defined as fake_manifest.url value in robottelo.properties (default: ‘default’)

Returns

A file-like object (BytesIO on Python 3 and StringIO on Python 2) with the contents of the cloned manifest.

original(self, name='default')

Returns the original manifest as a file-like object.

Parameters

name – A name of the manifest as defined in robottelo.properties

Be aware that using the original manifest and not removing it afterwards will make it impossible to import it to any other Organization.

Make sure to close the returned file-like object in order to clean up the memory used to store it.

robottelo.manifests._manifest_cloner
class robottelo.manifests.Manifest(content=None, filename=None, org_environment_access=False, name='default')

Class that holds the contents of a manifest with a generated filename based on time.time.

To ensure that the manifest content is closed use this class as a context manager with the with statement:

with Manifest() as manifest:
    # my fancy stuff
property content(self)
__enter__(self)
__exit__(self, type, value, traceback)
robottelo.manifests.clone(org_environment_access=False, name='default')

Clone the cached manifest and return a Manifest object.

Parameters
  • org_environment_access – Whether to modify consumer content access mode to org_environment (Golden ticket enabled manifest).

  • name – key name of the fake_manifests.url dict defined in robottelo.properties

Is hightly recommended to use this with the with statement to make that the content of the manifest (file-like object) is closed properly:

with clone() as manifest:
    # my fancy stuff
robottelo.manifests.original_manifest(name='default')

Returns a Manifest object filed with the template manifest.

Parameters

name – key name of the fake_manifests.url dict defined in robottelo.properties

Make sure to remove the manifest after its usage otherwiser the Satellite 6 server will not accept it anymore on any other organization.

Is hightly recommended to use this with the with statement to make that the content of the manifest (file-like object) is closed properly:

with original_manifest() as manifest:
    # my fancy stuff
robottelo.manifests.upload_manifest_locked(org_id, manifest=None, interface=INTERFACE_API, timeout=None)

Upload a manifest with locking, using the requested interface.

Returns

the upload result

Note: The manifest uploading is strictly locked only when using this

function

Usage:

# for API interface
manifest = manifests.clone()
upload_manifest_locked(org_id, manifest, interface=INTERFACE_API)

# for CLI interface
manifest = manifests.clone()
upload_manifest_locked(org_id, manifest, interface=INTERFACE_CLI)

# or in one line with default interface
result = upload_manifest_locked(org_id, manifests.clone())
subscription_id = result[id']