appngizer package

Submodules

appngizer.client module

This module contains network clients which are used to communicate with an appNGizer instance.

Currently there is only an implementation of a XMLClient.

class appngizer.client.Client(url, sharedsecret)[source]

Bases: object

Abstract class of an appNGizer client All further appNGizer clients will inherits from this class

request(method, path, pdata=None)[source]

Sends request to appNGizer instance

Parameters:
  • method (str) – HTTP method
  • path (str) – url to appNGizer instance
  • pdata (str) – data to send
Returns:

Client object

validate_url(url)[source]

Validates an url

Parameters:url (str) –
Returns:url as string if valide
class appngizer.client.ClientNetwork[source]

Bases: object

appNGizer ClientNetwork class

request(method, url, *args, **kwargs)[source]

Sends request to an appNGizer instance

Parameters:
  • method (str) – HTTP method
  • path (str) – url to appNGizer instance
  • args (list) – additional args for requests.Request object
  • kwargs (dict) – additional kwargs for requests.Request
Returns:

requests.Response object

class appngizer.client.Singleton[source]

Bases: type

Singleton class pattern to be used as metaclass for the Client.

class appngizer.client.XMLClient(url, sharedsecret)[source]

Bases: appngizer.client.Client

appNGizer XML Client class

appngizer.elements module

This module contains all appNG entities which currently can managed via an appNGizer instance.

class appngizer.elements.Application(name='', parents=[])[source]

Bases: appngizer.elements.Element

Class to manage an application

ATTRIBUTES = {'name': ''}
FIELDS = OrderedDict([('displayName', ''), ('privileged', False), ('fileBased', False), ('hidden', False), ('version', '')])
TYPE = 'Application'
TYPE_C = 'Applications'
assign(site)[source]

Assigns application to a site

Returns:bool (True if assigned)
deassign(site)[source]

Deassigns application from a site

Returns:bool (True if deassigned)
deassign_from_all()[source]

Deassigns application from all sites

Returns:bool (True if deassigned)
delete()[source]

Deletes an application

With additional check if application is assigned to any site before try to delete

Returns:bool (True if deleted)
is_assigned(site)[source]

Checks if application is assigned to a site

Returns:bool (True if is assigned)
is_update_needed(**xdict)[source]

Check if update of application settings is needed

Parameters:
  • xdict['displayName'] (str) – Name of application to display
  • xdict['privileged'] (bool) – Give privileged rights for application
  • xdict['fileBased'] (bool) – Store application in filesystem instead of database
  • xdict['hidden'] (bool) – Hide application in backend
Returns:

bool (True if needed), lxml.etree.Element (current), lxml.etree.Element (updated)

update(**xdict)[source]

Update application settings

Parameters:
  • xdict['displayName'] (str) – Name of application to display
  • xdict['privileged'] (bool) – Give privileged rights for application
  • xdict['fileBased'] (bool) – Store application in filesystem instead of database
  • xdict['hidden'] (bool) – Hide application in backend
Returns:

lxml.etree.Element

class appngizer.elements.Applications(name='', parents=[])[source]

Bases: appngizer.elements.Elements

Class to manage applications

SUBELEMENTS = {'application': []}
TYPE = 'Application'
TYPE_C = 'Applications'
class appngizer.elements.Database(name='', parents=[])[source]

Bases: appngizer.elements.Element

Class to manage site application databases of an appNG instance

ATTRIBUTES = {'id': ''}
CHILDS = OrderedDict()
FIELDS = OrderedDict([('type', ''), ('user', ''), ('password', ''), ('dbVersion', ''), ('driver', ''), ('url', ''), ('ok', '')])
TYPE = 'Database'
TYPE_C = 'Databases'
delete()[source]
Raises:appngizer.errors.ElementError – Method is not avaible for entity
gen_password_hash(password, salt)[source]

Generate bcrypt hash from plaintext password and salt

Parameters:
  • password (str) – Plaintext password
  • salt (str) – Plaintext salt
Returns:

str

is_update_needed(**xdict)[source]

Check if update of database is needed

Parameters:
  • xdict['user'] (str) – DB user
  • xdict['password'] (str) – DB password
  • xdict['driver'] (str) – DB driver to use
  • xdict['type'] (bool) – DB type to use
  • xdict['url'] (bool) – DB URI
Returns:

(bool (True if needed, False if not needed), lxml.etree.Element (current), lxml.etree.Element of (updated))

update(**xdict)[source]

Update database

Parameters:
  • xdict['user'] (str) – DB user
  • xdict['password'] (str) – DB password
  • xdict['driver'] (str) – DB driver to use
  • xdict['type'] (bool) – DB type to use
  • xdict['url'] (bool) – DB URI
Returns:

lxml.etree.Element

class appngizer.elements.Databases(name='', parents=[])[source]

Bases: appngizer.elements.Elements

Class to manage databases

SUBELEMENTS = {'database': []}
TYPE = 'Database'
TYPE_C = 'Databases'
class appngizer.elements.Element(name='', parents=[])[source]

Bases: appngizer.elements.XMLElement

Abstract class of an appNG entity

delete()[source]

Delete entity

Returns:bool (True if successfully)
exist()[source]

Check if entity already exist

Returns:bool (True if exist, False if not exist)
get_url_dict()[source]

Return dictionary with url path components of the entity

url[‘self’] url path to entity url[‘ancestor’] url path to entity type url[‘parents’] url path of parent entities
Returns:dict
load()[source]

Load entity via GET and set self.xml from requests.Response.content :return: None

load_if_needed()[source]

Load entity only if it’s not already loaded and not modified by any methods :return: None

read()[source]

Read entity and return as lxml.etree.Element :return: lxml.etree.Element

class appngizer.elements.Elements(name='', parents=[])[source]

Bases: appngizer.elements.Element

Abstract class of an appNGizer container element

delete()[source]
Raises:appngizer.errors.ElementError – Method is not avaible for entity
exist()[source]
Raises:appngizer.errors.ElementError – Method is not avaible for entity
is_update_needed(**xdict)[source]
Raises:appngizer.errors.ElementError – Method is not avaible for entity
class appngizer.elements.Grant(name='', parents=[])[source]

Bases: appngizer.elements.Element

Class to manage a site application grant

TYPE = 'Grant'
TYPE_C = 'Grant'
delete()[source]
Raises:appngizer.errors.ElementError – Method is not avaible for entity
load()[source]

Load grant data from Grants object :return: None

class appngizer.elements.Grants(name='', parents=[])[source]

Bases: appngizer.elements.Elements

Class to manage site application grants

SUBELEMENTS = {'grant': []}
TYPE = 'Grant'
TYPE_C = 'Grants'
get_grant(name)[source]

Get grant ObjectifiedElement of a site :param str name: Name of site :return: lxml.objectify.ObjectifiedElement

get_url_dict()[source]

Return dictionary with url path components of the entity

url[‘self’] url path to entity url[‘ancestor’] url path to entity type url[‘parents’] url path of parent entities
Returns:dict
update_grant(name, is_granted)[source]

Update grant for a site :param str name: Name of site :param bool is_granted: Site is granted to access application :return: lxml.objectify.ObjectifiedElement

update_grants(grants=[])[source]

Update all grants of a site application :param list grants: List of grant lxml.objectify.ObjectifiedElements :return: lxml.objectify.ObjectifiedElement

class appngizer.elements.Group(name='', parents=[])[source]

Bases: appngizer.elements.Element

Class to manage a group

ATTRIBUTES = {'name': ''}
CHILDS = OrderedDict([('roles', None)])
FIELDS = OrderedDict([('description', '')])
PRESERVED_FIELDS = ['description']
TYPE = 'Group'
TYPE_C = 'Groups'
create(**xdict)[source]

Create group

Parameters:
  • xdict['description'] (str) – Short description of group
  • xdict['roles'] (list) – List of role lxml.objectify.ObjectifiedElements
Returns:

lxml.etree.Element

is_update_needed(**xdict)[source]

Check if update of group is needed

Parameters:
  • xdict['description'] (str) – Short description of group
  • xdict['roles'] (list) – List of role lxml.objectify.ObjectifiedElements
Returns:

(bool (True if needed), lxml.etree.Element (current), lxml.etree.Element (updated))

update(**xdict)[source]

Update group

Parameters:
  • xdict['description'] (str) – Short description of group
  • xdict['roles'] (list) – List of role lxml.objectify.ObjectifiedElements
Returns:

lxml.etree.Element

class appngizer.elements.Groups(name='', parents=[])[source]

Bases: appngizer.elements.Elements

Class to manage groups

SUBELEMENTS = {'group': []}
TYPE = 'Group'
TYPE_C = 'Groups'
class appngizer.elements.Package(name=None, parents=[])[source]

Bases: appngizer.elements.Element

Class to manage a package

ATTRIBUTES = {'name': ''}
FIELDS = OrderedDict([('displayName', ''), ('version', ''), ('timestamp', ''), ('installed', False), ('type', 'APPLICATION')])
TYPE = 'Package'
TYPE_C = 'Packages'
delete()[source]
Raises:appngizer.errors.ElementError – Method is not avaible for entity
exist(**xdict)[source]

Checks if a package exist

Parameters:
  • xdict['version'] (str) – Filter for a specific version
  • xdict['timestamp'] (str) – Filter for a specific timestamp
Returns:

bool (True if exist)

install(**xdict)[source]

Install a package

Parameters:
  • xdict['version'] (str) – Install a specific version
  • xdict['timestamp'] (str) – Install a specific timestamp
  • xdict['allow_snapshot'] (bool) – Allow snapshot packages if no specific version is given
Returns:

lxml.etree.Element

is_installed()[source]

Checks if a package is already installed

Returns:bool (True if installed)
is_update_needed(**xdict)[source]

Checks if update of an installed package is needed

Parameters:
  • xdict['version'] (str) – Update to a specific version
  • xdict['timestamp'] (str) – Update to a specific timestamp
  • xdict['allow_snapshot'] (bool) – Allow snapshot packages if no specific version is given
Returns:

bool (True if needed), lxml.etree.Element (current), lxml.etree.Element (updated)

load()[source]

Load package data from Packages object :return: None

update() is an alias for install()[source]
class appngizer.elements.Packages(name=None, parents=[])[source]

Bases: appngizer.elements.Elements

Class to manage packages

SUBELEMENTS = {'package': []}
TYPE = 'Package'
TYPE_C = 'Packages'
find(**xdict)[source]

Find all available packages of a package

Parameters:
  • xdict['name']* (str) – Name of package
  • xdict['filter'] (dict) – Dictionary of field:value items to filter packages
Returns:

lxml.objectify.ObjectifiedElement

load()[source]

Load entity via GET and set self.xml from requests.Response.content :return: None

sort_packages_by_version(xml_obj)[source]

Sort packages by version

Parameters:xml_obj (lxml.objectify.ObjectifiedElement) – Packages ObjectifiedElement to sort
Returns:lxml.objectify.ObjectifiedElement
class appngizer.elements.Permission(name=None, parents=[])[source]

Bases: appngizer.elements.Element

Class to manage a permission

ATTRIBUTES = {'name': ''}
FIELDS = OrderedDict([('application', ''), ('description', '')])
PRESERVED_FIELDS = ['description']
TYPE = 'Permission'
TYPE_C = 'Permissions'
create(**xdict)[source]

Create permission

Parameters:xdict['description'] (str) – Short description of permission
Returns:lxml.etree.Element
is_update_needed(**xdict)[source]

Check if update of permission is needed

Parameters:xdict['description'] (str) – Short description of permission
Returns:(bool (True if needed), lxml.etree.Element (current), lxml.etree.Element (updated))
update(**xdict)[source]

Update permission

Parameters:xdict['description'] (str) – Short description of permission
Returns:lxml.etree.Element
class appngizer.elements.Permissions(name='', parents=[])[source]

Bases: appngizer.elements.Elements

Class to manage permissions

SUBELEMENTS = {'permission': []}
TYPE = 'Permission'
TYPE_C = 'Permissions'
class appngizer.elements.Platform(name='', parents=[])[source]

Bases: appngizer.elements.Element

Class to manage the platform

TYPE = 'Platform'
TYPE_C = 'Platform'
delete()[source]
Raises:appngizer.errors.ElementError – Method is not avaible for entity
class appngizer.elements.Properties(name='', parents=[])[source]

Bases: appngizer.elements.Elements

Class to manage properties

SUBELEMENTS = {'property': []}
TYPE = 'Property'
TYPE_C = 'Properties'
class appngizer.elements.Property(name='', parents=[])[source]

Bases: appngizer.elements.Element

Class to manage a property

ATTRIBUTES = {'name': '', 'clob': False}
FIELDS = OrderedDict([('value', ''), ('defaultValue', ''), ('description', '')])
PRESERVED_FIELDS = ['description', 'defaultValue']
TYPE = 'Property'
TYPE_C = 'Properties'
create(**xdict)[source]

Create property

Parameters:
  • xdict['value'] (str) – Value of property
  • xdict['defaultValue'] (str) – Default value of property
  • xdict['description'] (str) – Short description of property
  • xdict['clob'] (bool) – Threat value as clob
Returns:

lxml.etree.Element

is_update_needed(**xdict)[source]

Check if update of property is needed

Parameters:
  • xdict['value'] (str) – Value of property
  • xdict['defaultValue'] (str) – Default value of property
  • xdict['description'] (str) – Short description of property
  • xdict['clob'] (bool) – Threat value as clob
Returns:

(bool (True if needed, False if not needed), lxml.etree.Element of current property, lxml.etree.Element of desired property)

update(**xdict)[source]

Update property

Parameters:
  • xdict['value'] (str) – Value of property
  • xdict['defaultValue'] (str) – Default value of property
  • xdict['description'] (str) – Short description of property
  • xdict['clob'] (bool) – Threat value as clob
Returns:

lxml.etree.Element

class appngizer.elements.Repositories(name='', parents=[])[source]

Bases: appngizer.elements.Elements

Class to manage repositories

SUBELEMENTS = {'repository': []}
TYPE = 'Repository'
TYPE_C = 'Repositories'
class appngizer.elements.Repository(name='', parents=[])[source]

Bases: appngizer.elements.Element

Class to manage a repository

ATTRIBUTES = {'name': ''}
FIELDS = OrderedDict([('description', ''), ('remoteName', None), ('uri', None), ('enabled', True), ('strict', False), ('published', False), ('mode', 'ALL'), ('type', 'LOCAL'), ('packages', None)])
PRESERVED_FIELDS = ['description']
TYPE = 'Repository'
TYPE_C = 'Repositories'
create(**xdict)[source]

Create repository

Parameters:
  • xdict['description'] (str) – Short description of repository
  • xdict['remoteName'] (str) – Remote name of a remote repository
  • xdict['uri']* (str) – URI to repository
  • xdict['enabled'] (bool) – Enable repository
  • xdict['strict'] (bool) – Use strict mode for repository
  • xdict['published'] (bool) – Publish this repository as remote repository
  • xdict['mode'] (str) – Type of packages to serve (ALL|STABLE|SNAPSHOT)
  • xdict['type'] (str) – Type of repository (LOCAL|REMOTE)
Returns:

lxml.etree.Element

has_pkg(**xdict)[source]

Check if repository have a package

Parameters:xdict['name']* (str) – name of package
Returns:bool
is_update_needed(**xdict)[source]

Check if update of repository is needed

Parameters:
  • xdict['description'] (str) – Short description of repository
  • xdict['remoteName'] (str) – Remote name of a remote repository
  • xdict['uri'] (str) – URI to repository
  • xdict['enabled'] (bool) – Enable repository
  • xdict['strict'] (bool) – Use strict mode for repository
  • xdict['published'] (bool) – Publish this repository as remote repository
  • xdict['mode'] (str) – Type of packages to serve (ALL|STABLE|SNAPSHOT)
  • xdict['type'] (str) – Type of repository (LOCAL|REMOTE)
Returns:

bool (True if needed, False if not needed), lxml.etree.Element of current repository, lxml.etree.Element of updated repository

list_pkg(**xdict)[source]

Get a list of all variants of a package in the repository

Parameters:xdict['name']* (str) – name of package
Returns:lxml.objectify.ObjectifiedElement
list_pkgs()[source]

Get a list of all packages in the repository

Returns:lxml.objectify.ObjectifiedElement
update(**xdict)[source]

Update repository

Parameters:
  • xdict['description'] (str) – Short description of repository
  • xdict['remoteName'] (str) – Remote name of a remote repository
  • xdict['uri'] (str) – URI to repository
  • xdict['enabled'] (bool) – Enable repository
  • xdict['strict'] (bool) – Use strict mode for repository
  • xdict['published'] (bool) – Publish this repository as remote repository
  • xdict['mode'] (str) – Type of packages to serve (ALL|STABLE|SNAPSHOT)
  • xdict['type'] (str) – Type of repository (LOCAL|REMOTE)
Returns:

lxml.etree.Element

class appngizer.elements.Role(name=None, parents=[])[source]

Bases: appngizer.elements.Element

Class to manage a role

ATTRIBUTES = {'name': ''}
CHILDS = OrderedDict([('permissions', None)])
FIELDS = OrderedDict([('application', ''), ('description', '')])
PRESERVED_FIELDS = ['description']
TYPE = 'Role'
TYPE_C = 'Roles'
create(**xdict)[source]

Create role

Parameters:
  • xdict['description'] (str) – Short description of role
  • xdict['permissions'] (list) – List of permission lxml.objectify.ObjectifiedElements
Returns:

lxml.etree.Element

is_update_needed(**xdict)[source]

Check if update of role is needed

Parameters:
  • xdict['description'] (str) – Short description of role
  • xdict['permissions'] (list) – List of permission lxml.objectify.ObjectifiedElements
Returns:

(bool (True if needed), lxml.etree.Element (current), lxml.etree.Element (updated))

update(**xdict)[source]

Update role

Parameters:
  • xdict['description'] (str) – Short description of role
  • xdict['permissions'] (list) – List of permission lxml.objectify.ObjectifiedElements
Returns:

lxml.etree.Element

class appngizer.elements.Roles(name='', parents=[])[source]

Bases: appngizer.elements.Elements

Class to manage roles

SUBELEMENTS = {'role': []}
TYPE = 'Role'
TYPE_C = 'Roles'
class appngizer.elements.Site(name='', parents=[])[source]

Bases: appngizer.elements.Element

Class to manage a site

ATTRIBUTES = OrderedDict([('name', '')])
FIELDS = OrderedDict([('host', ''), ('domain', ''), ('description', ''), ('active', True), ('createRepositoryPath', False)])
PRESERVED_FIELDS = ['description', 'domain']
TYPE = 'Site'
TYPE_C = 'Sites'
create(**xdict)[source]

Create site

Parameters:
  • xdict['host']* (str) – Hostname of site
  • xdict['domain']* (str) – Main URI of site
  • xdict['description'] (str) – Short description of site
  • xdict['active'] (bool) – Activate site
  • xdict['createRepositoryPath'] (bool) – Create site repository directory
Returns:

lxml.etree.Element

is_update_needed(**xdict)[source]

Check if update of site is needed

Parameters:
  • xdict['host'] (str) – Hostname of site
  • xdict['domain'] (str) – Main URI of site
  • xdict['description'] (str) – Short description of site
  • xdict['active'] (bool) – Activate site
  • xdict['createRepositoryPath'] (bool) – Create site repository directory
Returns:

bool (True if needed, False if not needed), lxml.etree.Element of current site, lxml.etree.Element of updated site

reload()[source]

Reload site

Returns:bool (True if reloaded, False if not reloaded)
update(**xdict)[source]

Update site

Parameters:
  • xdict['host'] (str) – Hostname of site
  • xdict['domain'] (str) – Main URI of site
  • xdict['description'] (str) – Short description of site
  • xdict['active'] (bool) – Activate site
  • xdict['createRepositoryPath'] (bool) – Create site repository directory
Returns:

lxml.etree.Element

class appngizer.elements.Sites(name='', parents=[])[source]

Bases: appngizer.elements.Elements

Class to manage sites

SUBELEMENTS = {'site': []}
TYPE = 'Site'
TYPE_C = 'Sites'
class appngizer.elements.Subject(name='', parents=[])[source]

Bases: appngizer.elements.Element

Class to manage a subject

ATTRIBUTES = {'name': ''}
CHILDS = OrderedDict([('groups', None)])
FIELDS = OrderedDict([('realName', ''), ('email', ''), ('description', ''), ('digest', ''), ('timeZone', 'Europe/Berlin'), ('language', 'en'), ('type', 'LOCAL_USER')])
PRESERVED_FIELDS = ['description', 'email', 'timeZone', 'language', 'type']
TYPE = 'Subject'
TYPE_C = 'Subjects'
create(**xdict)[source]

Create subject

Parameters:
  • xdict['realName']* (str) – Real name of subject
  • xdict['email']* (str) – E-Mail address of subject
  • xdict['description'] (str) – Short description of subject
  • xdict['digest']* (str) – Password as plaintext or bcrypt hash
  • xdict['timeZone'] (str) – Timezone for subject
  • xdict['language'] (str) – Language for subject
  • xdict['type'] (str) – Type of subject (LOCAL_USER|GLOBAL_USER|GLOBAL_GROUP)
Returns:

lxml.etree.Element

digest_match_hash(digest, hashed)[source]

Check if digest match hash

If digest does not start with ‘$2a$’ it will handled as plaintext otherwise digest is directly matched against hashed

Parameters:
  • digest (str) – digest of subject
  • hashed (str) – bcrypt hash of digest to match
Returns:

bool (True if match)

is_update_needed(**xdict)[source]

Check if update of subject is needed

Parameters:
  • xdict['realName'] (str) – Real name of subject
  • xdict['email'] (str) – E-Mail address of subject
  • xdict['description'] (str) – Short description of subject
  • xdict['digest'] (str) – Password as plaintext or bcrypt hash
  • xdict['timeZone'] (str) – Timezone for subject
  • xdict['language'] (str) – Language for subject
  • xdict['type'] (str) – Type of subject (LOCAL_USER|GLOBAL_USER|GLOBAL_GROUP)
Returns:

(bool (True if needed), lxml.etree.Element (current), lxml.etree.Element (updated))

update(**xdict)[source]

Update subject

Parameters:
  • xdict['realName'] (str) – Real name of subject
  • xdict['email'] (str) – E-Mail address of subject
  • xdict['description'] (str) – Short description of subject
  • xdict['digest'] (str) – Password as plaintext or bcrypt hash
  • xdict['timeZone'] (str) – Timezone for subject
  • xdict['language'] (str) – Language for subject
  • xdict['type'] (str) – Type of subject (LOCAL_USER|GLOBAL_USER|GLOBAL_GROUP)
Returns:

lxml.etree.Element

class appngizer.elements.Subjects(name='', parents=[])[source]

Bases: appngizer.elements.Elements

Class to manage subjects

SUBELEMENTS = {'subject': []}
TYPE = 'Subject'
TYPE_C = 'Subjects'
class appngizer.elements.XMLElement[source]

Bases: object

Abstract class for an XML appNG entity

ATTRIBUTES = OrderedDict()
CDATA_FIELDS = []
CHILDS = OrderedDict()
FIELDS = OrderedDict()
NS_PREFIX = '{http://www.appng.org/schema/appngizer}'
PRESERVED_FIELDS = []
SUBELEMENTS = OrderedDict()
TYPE = 'Element'
TYPE_C = 'Elements'
XPATH_DEFAULT_NAMESPACE = {'a': 'http://www.appng.org/schema/appngizer'}
XSD_APPNGIZER_PATH = '/var/lib/jenkins/workspace/appngizer_feature_objectify-H5EZDP6TVQNX6VTIPN4UUYMQEMYH5EIZE7GTXGVIUZGIV4DTQDWA/appngizer/appngizer.xsd'
convert_xml_element_to_xml_obj(xml=None)[source]

Convert lxml.etree.Element to lxml.objectify.ObjectifiedElement

Parameters:xml (lxml.etree.Element) – Element to convert
Returns:lxml.objectify.ObjectifiedElement
convert_xml_obj_to_xml_element(xml_obj=None)[source]

Convert lxml.objectify.ObjectifiedElement to lxml.etree.Element

Parameters:xml_obj (lxml.objectify.ObjectifiedElement) – ObjectifiedElement to convert
Returns:lxml.etree.Element
dump(xml=None)[source]

Pretty print an lxml.etree.Element or lxml.objectify.ObjectifiedElement as string

Parameters:
  • xml (lxml.objectify.ObjectifiedElement) – Element to pretty print
  • xml – ObjectifiedElement to pretty print
Returns:

string

get_xml_str(xml_obj=None)[source]

Deannotates lxml.objectify.ObjectifiedElement and return as string

Parameters:xml_obj (lxml.objectify.ObjectifiedElement) – ObjectifiedElement to return as string
Returns:ObjectifiedElement as string
is_valide_xml(xml=None)[source]

Validate lxml.etree.Element against the appNGizer xsd schema

Parameters:xml (lxml.etree.Element) – Element to be validated, if not self.xml is used
Returns:bool
strip_ns_prefix(xml)[source]

Strip namespaces from lxml.etree.Element and return it

Parameters:xml (lxml.etree.Element) – Element to strip
Returns:lxml.etree.Element

appngizer.errors module

exception appngizer.errors.CLIError[source]

Bases: exceptions.Exception

exception appngizer.errors.ClientError[source]

Bases: appngizer.errors.Error

exception appngizer.errors.ElementError[source]

Bases: appngizer.errors.Error

exception appngizer.errors.ElementNotFound[source]

Bases: appngizer.errors.Error

exception appngizer.errors.Error[source]

Bases: exceptions.Exception

exception appngizer.errors.HttpClientBadRequest[source]

Bases: appngizer.errors.Error

exception appngizer.errors.HttpElementConflict[source]

Bases: appngizer.errors.Error

exception appngizer.errors.HttpElementForbidden[source]

Bases: appngizer.errors.Error

exception appngizer.errors.HttpElementNotFound[source]

Bases: appngizer.errors.Error

exception appngizer.errors.HttpServerError[source]

Bases: appngizer.errors.Error

exception appngizer.errors.NotAllowedOp[source]

Bases: appngizer.errors.Error

exception appngizer.errors.XMLValidationError[source]

Bases: appngizer.errors.Error

Module contents