Skip to content

Commit

Permalink
Fixes #15903: Impossible to save virtuozzo inventory (missing LDAP ob…
Browse files Browse the repository at this point in the history
…ject)
  • Loading branch information
fanf committed Oct 9, 2019
1 parent 9baaeb0 commit 023cfc1
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ trait PipelinedReportSaver[R] extends ReportSaver[R] with Loggable {
commitedChange <- try {
commitChange(postPreCommitReport)
} catch {
case ex:Exception => Failure("Exception when commiting inventory, abort.", Full(ex), Empty)
case ex:Exception => Failure(s"Exception when commiting inventory, abort: ${ex.getMessage}", Full(ex), Empty)
}

t2 = System.currentTimeMillis
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,12 @@ class InventoryProcessor(
(reportSaver.save(report) ?~! "Can't merge inventory report in LDAP directory, aborting") match {
case Empty => logger.error("The report is empty, not saving anything")
case f:Failure =>
logger.error("Error when trying to process report: %s".format(f.messageChain),f)
logger.error(s"Error when trying to process report: ${f.messageChain}")
if(logger.isDebugEnabled) {
f.rootExceptionCause.foreach{ ex =>
logger.debug("Root exception was: " + ex.printStackTrace())
}
}
case Full(report) =>
logger.debug("Report saved.")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -887,18 +887,35 @@ objectclass ( InventoryObjectClasses:80.6
SUP VirtualMachine
AUXILIARY )

objectclass ( InventoryObjectClasses:80:8
objectclass ( InventoryObjectClasses:80.7
NAME 'BSDJail'
DESC 'A BSD Jail'
SUP VirtualMachine
AUXILIARY )

objectclass ( InventoryObjectClasses:80.8
NAME 'hyperV'
DESC 'A Hyper-V VM'
SUP VirtualMachine
AUXILIARY )

objectclass ( InventoryObjectClasses:80.7
NAME 'BSDJail'
DESC 'A BSD Jail'
objectclass ( InventoryObjectClasses:80.9
NAME 'lxc'
DESC 'LXC container'
SUP VirtualMachine
AUXILIARY )

objectclass ( InventoryObjectClasses:80.10
NAME 'virtuozzo'
DESC 'Virtuozzo container'
SUP VirtualMachine
AUXILIARY )

objectclass ( InventoryObjectClasses:80.11
NAME 'openvz'
DESC 'OpenVZ container'
SUP VirtualMachine
AUXILIARY )

objectclass ( InventoryObjectClasses:4
NAME 'physicalElement'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,10 @@ class InventoryMapper(
case LDAPObjectClass(OC_VM_QEMU,_,_,_) => Some(VirtualMachineType(QEmu))
case LDAPObjectClass(OC_VM_AIX_LPAR,_,_,_) => Some(VirtualMachineType(AixLPAR))
case LDAPObjectClass(OC_VM_HYPERV,_,_,_) => Some(VirtualMachineType(HyperV))
case LDAPObjectClass(OC_VM_BSDJAIL,_,_,_) => Some(VirtualMachineType(BSDJail))
case LDAPObjectClass(OC_VM_BSDJAIL,_,_,_) => Some(VirtualMachineType(BSDJail))
case LDAPObjectClass(OC_VM_LXC, _, _, _) => Some(VirtualMachineType(LXC))
case LDAPObjectClass(OC_VM_VIRTUOZZO, _, _, _) => Some(VirtualMachineType(Virtuozzo))
case LDAPObjectClass(OC_VM_OPENVZ, _, _, _) => Some(VirtualMachineType(OpenVZ))
case LDAPObjectClass(OC_PM,_,_,_) => Some(PhysicalMachineType)
case _ => None
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,10 @@ object LDAPConstants {
OC +=(OC_VM_AIX_LPAR, OC(OC_VM))
OC +=(OC_VM_HYPERV, OC(OC_VM))
OC +=(OC_VM_BSDJAIL, OC(OC_VM))
OC +=(OC_VM_LXC, OC(OC_VM))
OC +=(OC_VM_VIRTUOZZO, OC(OC_VM))
OC +=(OC_VM_OPENVZ, OC(OC_VM))


OC +=(OC_PE,
must = Set(),
Expand All @@ -301,7 +305,10 @@ object LDAPConstants {
OC_VM_QEMU,
OC_VM_AIX_LPAR,
OC_VM_HYPERV,
OC_VM_BSDJAIL
OC_VM_BSDJAIL,
OC_VM_LXC,
OC_VM_VIRTUOZZO,
OC_VM_OPENVZ
)

OC +=(OC_MEMORY, sup = OC(OC_PE),
Expand Down

0 comments on commit 023cfc1

Please sign in to comment.