Fixes a style issue introduced by b31ab119 ("client: improve api error
message (avoid duplicate status code)"), as one always should use
inline variables for format template strings even if there are some
that cannot be used, e.g. as some method needs to be called on them
like here. The reason for this is to reduce the amount of
free-standing "{}" and parameters as that reduces the need to manually
match what "{}" resolves to which expression. While it is not that bad
for only two format variables it's still not winning us anything if we
don't do it and breaks consistency with newer code style.
Noticed as that commit made the line overly long, causing rustfmt
changing the line.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
The libc function mkdtemp takes a C char pointer while we previously
cast our OSString buffer as i8 pointer, but that's not valid on
platforms like AArch64 (ARM), where char is equivalent with a u8.
Fix that by using the c_char type that was explicitly made to always
get the correct, platform-independent type for C chars when doing FFI.
This was reported by OJaksch on our Arch Linux User Repo (AUR) package
[0].
https://aur.archlinux.org/packages/proxmox-backup-client#comment-1006851
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This way we can copy and modify a schema.
Eg. via the following ways:
const FOO_SCHEMA: Schema = SOME_SCHEMA
.unwrap_integer_schema_cloned()
.description("Foo")
.schema();
Note that for example there is currently no builder to set a
`default_key` for an `ObjectSchema` back to None, so one could do:
const FOO_SCHEMA: Schema = const {
let mut schema = SOME_SCHEMA.unwrap_object_schema_cloned();
schema.default_key = None;
schema.schema()
};
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Because the UI kept producing them...
And still does...
This is NOT meant to be used by anything other than generated legacy
code for PDM (pve-api-types) and only affects the serde based
deserializer. The "old" `schema.parse_property_string() -> Value`
method does not utilize this for now.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
To prepare for a breaking change in proxmox-schema.
Since new fields in the schema constitute a breaking change, using the
builder methods will let this compile later as well.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
so that we can have a property:
```
foo: Option<PropertyString<Bar>>,
```
within a struct that derives `Updater`
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
We tried this unconditionally on start-up in the PDM for the priv. API
daemon, but we actually only want to clean-up on fresh bind, not on
restoring the FD on daemon reload. Otherwise the unprivileged daemon
cannot connect to the privileged one anymore after the latter got
reloaded.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
For consistency with it's other repositories, we might migrate other
products also to this schema with a future major release (and nginx
rewrite config for backward compatibility)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Migrated from `log` to `tracing`. Imported `tracing` only as it has a
smaller footprint (and less dependencies) than `proxmox_log`.
Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>