mirror of
https://git.proxmox.com/git/proxmox
synced 2025-05-28 18:15:28 +00:00
subscription: expose the next_due_date
as an i64
internally `SubscriptionInfo` already uses the `parse_next_due` helper to parse the next due date to an epoch. this exposes a function that allows us to use the epoch outside of this crate too. for example, a user of pom may have multiple subscription for the same system. in that case we want to apply the one with the due date that is furthest in the future. Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
This commit is contained in:
parent
81cdba6181
commit
ee7a908ebc
@ -286,6 +286,13 @@ impl SubscriptionInfo {
|
||||
.ok_or_else(|| format_err!("no product key set"))
|
||||
.map(|key| key[..3].parse::<ProductType>())?
|
||||
}
|
||||
|
||||
pub fn get_next_due_date(&self) -> Result<i64, Error> {
|
||||
self.nextduedate
|
||||
.as_ref()
|
||||
.ok_or_else(|| format_err!("no next due date set"))
|
||||
.map(|e| parse_next_due(e))?
|
||||
}
|
||||
}
|
||||
|
||||
/// Shortcut for md5 sums.
|
||||
|
Loading…
Reference in New Issue
Block a user