Skip to content

Commit

Permalink
[squashme] howto pyhon enum plz?
Browse files Browse the repository at this point in the history
  • Loading branch information
chr4 committed Sep 22, 2023
1 parent 82442d8 commit 8ae3b07
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
3 changes: 0 additions & 3 deletions include/netplan.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,6 @@ netplan_netdef_get_vlan_link(const NetplanNetDefinition* netdef);
NETPLAN_PUBLIC NetplanNetDefinition*
netplan_netdef_get_sriov_link(const NetplanNetDefinition* netdef);

NETPLAN_PUBLIC char *
netplan_netdef_get_keep_configuration(const NetplanNetDefinition* netdef);

NETPLAN_PUBLIC ssize_t
netplan_netdef_get_set_name(const NetplanNetDefinition* netdef, char* out_buffer, size_t out_buffer_size);

Expand Down
3 changes: 2 additions & 1 deletion python-cffi/netplan/_build_cffi.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
typedef struct netplan_net_definition NetplanNetDefinition;
typedef enum { ... } NetplanBackend;
typedef enum { ... } NetplanDefType;
typedef enum { ... } NetplanCriticalOption;
// TODO: Introduce getters for .address/.lifetime/.label to avoid exposing the raw struct
typedef struct {
Expand Down Expand Up @@ -112,7 +113,7 @@
ssize_t _netplan_netdef_get_embedded_switch_mode(const NetplanNetDefinition* netdef, char* out_buffer, size_t out_buf_size);
gboolean _netplan_netdef_get_sriov_vlan_filter(const NetplanNetDefinition* netdef);
guint _netplan_netdef_get_vlan_id(const NetplanNetDefinition* netdef);
char* netplan_netdef_get_keep_configuration(const NetplanNetDefinition* netdef);
NetplanCriticalOption _netplan_netdef_get_critical(const NetplanNetDefinition* netdef);
gboolean _netplan_netdef_is_trivial_compound_itf(const NetplanNetDefinition* netdef);
int _netplan_state_get_vf_count_for_def(
const NetplanState* np_state, const NetplanNetDefinition* netdef, NetplanError** error);
Expand Down
4 changes: 2 additions & 2 deletions python-cffi/netplan/netdef.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ def set_name(self) -> str:
return _string_realloc_call_no_error(lambda b: lib.netplan_netdef_get_set_name(self._ptr, b, len(b)))

@property
def keep_configuration(self) -> str:
return _string_realloc_call_no_error(lambda b: lib.netplan_netdef_get_keep_configuration(self._ptr, b, len(b)))
def critical(self) -> bool:
return bool(lib._netplan_netdef_get_critical(self._ptr))

@property
def links(self) -> dict:
Expand Down

0 comments on commit 8ae3b07

Please sign in to comment.