d7330d0f44
Primary reason for this change was to update the spec and setup files from basic setuptools to use pbr This allows the autogenerated /usr/bin/system file to directly call the main method without using pkg-resources. This will provide a performance improvement of .5 seconds per CLI call, once the other pkg_resources issues are resolved Second reason for this change was to wire in the tox unit tests. This also includes pep8, pylint and coverage. Currently pep8 does not perform the 80 char limit check Currently pylint still reports some issues This should not affect the RPM names being generated or otherwise affect patching or upgrades. Change-Id: I9f14c9216fdcc63930a4b2849102b58442706144
31 lines
622 B
Python
31 lines
622 B
Python
#
|
|
# Copyright (c) 2017 Wind River Systems, Inc.
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
|
|
# -*- encoding: utf-8 -*-
|
|
#
|
|
|
|
from cgtsclient.common import base
|
|
|
|
|
|
class License(base.Resource):
|
|
def __repr__(self):
|
|
return "<license %s>" % self._info
|
|
|
|
|
|
class LicenseManager(base.Manager):
|
|
resource_class = License
|
|
|
|
@staticmethod
|
|
def _path(id=None):
|
|
return '/v1/license/%s' % id if id else '/v1/license'
|
|
|
|
def list(self):
|
|
return self._list(self._path(), "licenses")
|
|
|
|
def install_license(self, file):
|
|
path = self._path("install_license")
|
|
return self._upload(path, file)
|