Skip to content

Commit

Permalink
Update auto generated go opentestbed
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Jun 30, 2024
1 parent 93bc0b2 commit f2973af
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 80 deletions.
17 changes: 9 additions & 8 deletions goopentestbed/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"net"
"net/http"
"os"
"regexp"
"strconv"
"strings"
Expand Down Expand Up @@ -175,18 +176,18 @@ func (api *apiSt) getWarnings() string {
}

func (api *apiSt) addWarnings(message string) {
fmt.Printf("[WARNING]: %s\n", message)
fmt.Fprintf(os.Stderr, "[WARNING]: %s\n", message)
api.warnings = message
}

func (api *apiSt) deprecated(message string) {
api.warnings = message
fmt.Printf("warning: %s\n", message)
fmt.Fprintf(os.Stderr, "warning: %s\n", message)
}

func (api *apiSt) under_review(message string) {
api.warnings = message
fmt.Printf("warning: %s\n", message)
fmt.Fprintf(os.Stderr, "warning: %s\n", message)
}

// HttpRequestDoer will return True for HTTP transport
Expand Down Expand Up @@ -239,17 +240,17 @@ func (obj *validation) Warnings() []string {
}

func (obj *validation) addWarnings(message string) {
fmt.Printf("[WARNING]: %s\n", message)
fmt.Fprintf(os.Stderr, "[WARNING]: %s\n", message)
obj.warnings = append(obj.warnings, message)
}

func (obj *validation) deprecated(message string) {
fmt.Printf("warning: %s\n", message)
fmt.Fprintf(os.Stderr, "warning: %s\n", message)
obj.warnings = append(obj.warnings, message)
}

func (obj *validation) under_review(message string) {
fmt.Printf("warning: %s\n", message)
fmt.Fprintf(os.Stderr, "warning: %s\n", message)
obj.warnings = append(obj.warnings, message)
}

Expand Down Expand Up @@ -338,8 +339,8 @@ func (obj *validation) validateOid(oid string) error {
}

for _, segment := range segments {
number, err := strconv.Atoi(segment)
if err != nil || 0 > number || number > 4294967295 {
_, err := strconv.ParseUint(segment, 10, 32)
if err != nil {
return fmt.Errorf(fmt.Sprintf("Invalid oid value %s", oid))
}
}
Expand Down
2 changes: 1 addition & 1 deletion goopentestbed/goopentestbed.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ type Api interface {

func (api *goopentestbedApi) GetLocalVersion() Version {
if api.versionMeta.localVersion == nil {
api.versionMeta.localVersion = NewVersion().SetApiSpecVersion("0.0.5").SetSdkVersion("0.0.3")
api.versionMeta.localVersion = NewVersion().SetApiSpecVersion("0.0.5").SetSdkVersion("0.0.4")
}

return api.versionMeta.localVersion
Expand Down
13 changes: 8 additions & 5 deletions opentestbed/opentestbed.py
Original file line number Diff line number Diff line change
Expand Up @@ -979,15 +979,18 @@ def _raise_status_warnings(self, property_name, property_value):

if isinstance(property_name, OpenApiObject):
if "self" in self._STATUS and property_value is None:
print("[WARNING]: %s" % self._STATUS["self"])
print("[WARNING]: %s" % self._STATUS["self"], file=sys.stderr)

return

enum_key = "%s.%s" % (property_name, property_value)
if property_name in self._STATUS:
print("[WARNING]: %s" % self._STATUS[property_name])
print(
"[WARNING]: %s" % self._STATUS[property_name],
file=sys.stderr,
)
elif enum_key in self._STATUS:
print("[WARNING]: %s" % self._STATUS[enum_key])
print("[WARNING]: %s" % self._STATUS[enum_key], file=sys.stderr)


class OpenApiIter(OpenApiBase):
Expand Down Expand Up @@ -2561,14 +2564,14 @@ class Api(object):
def __init__(self, **kwargs):
self._version_meta = self.version()
self._version_meta.api_spec_version = "0.0.5"
self._version_meta.sdk_version = "0.0.3"
self._version_meta.sdk_version = "0.0.4"
self._version_check = kwargs.get("version_check")
if self._version_check is None:
self._version_check = False
self._version_check_err = None

def add_warnings(self, msg):
print("[WARNING]: %s" % msg)
print("[WARNING]: %s" % msg, file=sys.stderr)
self.__warnings__.append(msg)

def _deserialize_error(self, err_string):
Expand Down
120 changes: 60 additions & 60 deletions opentestbed/opentestbed_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
--prefer-binary
protobuf~=4.23.3 ; python_version > '3.6'
protobuf~=3.15.0 ; python_version <= '3.6'
grpcio-tools~=1.35.0 ; python_version <= '3.6'
grpcio-tools~=1.54.2 ; python_version > '3.6'
grpcio~=1.54.2 ; python_version > '3.6'
grpcio~=1.35.0 ; python_version <= '3.6'
requests
grpcio-tools~=1.35.0 ; python_version <= '3.6'
grpcio-tools~=1.59.0 ; python_version > '3.6'
grpcio~=1.59.0 ; python_version > '3.6'
protobuf~=4.24.4 ; python_version > '3.6'
protobuf~=3.15.0 ; python_version <= '3.6'
PyYAML
requests
semantic_version
urllib3

0 comments on commit f2973af

Please sign in to comment.