config/sysinv/cgts-client/cgts-client/cgtsclient/v1/fernet.py
Erich Cordoba fae45ff197 Remove shebang from non-executable scripts in cgts-client
The linters in the Opensuse build service are failing because cgts-client has
unneeded python shebangs in the code. This is because a python source code
file that is not intended to be executed shouldn't include this shebang.

Story: 2006508
Task: 36723

Change-Id: I7e46bd175ce3873168be6f28109aa0bd43e0bf5a
Signed-off-by: Erich Cordoba <erich.cordoba.malibran@intel.com>
2019-09-19 18:26:31 -05:00

36 lines
794 B
Python

#
# Copyright (c) 2018 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
from cgtsclient.common import base
class FernetKey(base.Resource):
def __repr__(self):
return "<keys %s>" % self._info
class FernetManager(base.Manager):
resource_class = FernetKey
@staticmethod
def _path(id=None):
return '/v1/fernet_repo/%s' % id if id else '/v1/fernet_repo'
def list(self):
return self._list(self._path(), "keys")
def get(self, id):
try:
return self._list(self._path(id))[0]
except IndexError:
return None
def create(self, data):
return self._create(self._path(), data)
def put(self, patch, id=None):
return self._update(self._path(id), patch, http_method='PUT')