Fix ptp and kube_rootca paths

Fix some ptp and kube_rootca by adding a leading / in the endpoint
path. This issue appeared after [1].

Test plan:
PASS: Verify ptp_interface endpoints from system CLI.
PASS: Verify kube_rootca endpoints from system CLI.

Story: 2008943
Task: 45298

[1] https://review.opendev.org/c/starlingx/config/+/803655

Signed-off-by: Iago Estrela <IagoFilipe.EstrelaBarros@windriver.com>
Change-Id: Ib1ba85c11da4fed09e656174ca33aedb3251ad61
This commit is contained in:
Iago Estrela 2022-05-05 09:35:13 -03:00
parent 3e649e1281
commit 3b5ea2a3c4
2 changed files with 5 additions and 5 deletions

View File

@ -17,7 +17,7 @@ class KubeRootCAUpdateManager(base.Manager):
@staticmethod
def _path(uuid=None):
return 'v1/kube_rootca_update/%s' % uuid if uuid else 'v1/kube_rootca_update/'
return '/v1/kube_rootca_update/%s' % uuid if uuid else '/v1/kube_rootca_update/'
def create(self, force):
"""Create a new entry for kubernetes rootca update operation """

View File

@ -24,18 +24,18 @@ class PtpInterfaceManager(base.Manager):
@staticmethod
def _path(ptp_interface_id=None):
return 'v1/ptp_interfaces/%s' % ptp_interface_id if ptp_interface_id \
else 'v1/ptp_interfaces'
return '/v1/ptp_interfaces/%s' % ptp_interface_id if ptp_interface_id \
else '/v1/ptp_interfaces'
def list(self, q=None):
return self._list(options.build_url(self._path(), q), "ptp_interfaces")
def list_by_host(self, host_id):
path = 'v1/ihosts/%s/ptp_interfaces' % host_id
path = '/v1/ihosts/%s/ptp_interfaces' % host_id
return self._list(path, "ptp_interfaces")
def list_by_interface(self, interface_id):
path = 'v1/iinterfaces/%s/ptp_interfaces' % interface_id
path = '/v1/iinterfaces/%s/ptp_interfaces' % interface_id
return self._list(path, "ptp_interfaces")
def get(self, ptp_interface_id):