コード例 #1
0
 def getFull(self):
     """ Get full configuration (inlcuding discovered parts) as nested namespace """
     logging.debug(f'self._config >>>{self._config}<<<')
     cleaned = ConfigBase.cleanup(self._config)
     logging.debug(f'cleaned >>>{cleaned}<<<')
     # return objToNestedNs(ConfigBase.cleanup(self._config))
     return objToNestedNs(self._config)
コード例 #2
0
    def _setOrgUser(self):
        userSwitch = True

        orgUserName = self.ocWhoami()

        if orgUserName == "kube:admin":
            orgUserName = "******"

        # Check for known users
        if orgUserName == self._user.name:
            return self._user, userSwitch
        if orgUserName == self._admin.name:
            return self._admin, userSwitch

        userSwitch = False

        # ocp user not set before
        if orgUserName == "":
            return None, userSwitch

        return objToNestedNs({"name": orgUserName}), userSwitch
コード例 #3
0
 def get(self):
     """ Get cleaned up configuration as nested namespace """
     return objToNestedNs(self.getObj())
コード例 #4
0
 def get(self):
     """ return deployment object """
     return objToNestedNs(self._deployment)
コード例 #5
0
 def _getServiceNameFromFile(self, file):
     serviceYaml = self._getServiceYaml(file)
     return objToNestedNs(serviceYaml).metadata.name
コード例 #6
0
 def _getOverlayUuidFromYaml(self, deploymentYaml):
     return objToNestedNs(deploymentYaml).metadata.labels.overlayUuid
コード例 #7
0
 def _getAppNameFromYaml(self, deploymentYaml):
     return objToNestedNs(deploymentYaml).metadata.labels.app
コード例 #8
0
 def _hasValidProject(self, file):
     deploymentYaml = self._getDeploymentYaml(file)
     project = objToNestedNs(deploymentYaml).metadata.namespace
     return project == self._ctx.cf.ocp.project