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 e8daf10 commit 3475bc7
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 13 deletions.
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
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
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
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
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
Expand Up @@ -323,6 +323,12 @@ attributeTypes: ( 1.3.6.1.4.1.35061.1.1.400.3
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )
attributeTypes: ( 1.3.6.1.4.1.35061.1.1.400.3.1
NAME 'networkSubnet'
DESC 'Network interface subnet'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )
attributeTypes: ( 1.3.6.1.4.1.35061.1.1.400.4
NAME 'networkInterfaceMacAddress'
DESC 'Network interface MAC address'
Expand Down Expand Up @@ -723,14 +729,29 @@ objectClasses: ( 1.3.6.1.4.1.35061.1.2.80.6
DESC 'An LPAR partition on AIX'
SUP VirtualMachine
AUXILIARY )
objectClasses: ( 1.3.6.1.4.1.35061.1.2.80
objectClasses: ( 1.3.6.1.4.1.35061.1.2.80.7
NAME 'BSDJail'
DESC 'A BSD Jail'
SUP VirtualMachine
AUXILIARY )
objectClasses: ( 1.3.6.1.4.1.35061.1.2.80.8
NAME 'hyperV'
DESC 'A Hyper-V VM'
SUP VirtualMachine
AUXILIARY )
objectClasses: ( 1.3.6.1.4.1.35061.1.2.80.7
NAME 'BSDJail'
DESC 'A BSD Jail'
objectClasses: ( 1.3.6.1.4.1.35061.1.2.80.9
NAME 'lxc'
DESC 'LXC container'
SUP VirtualMachine
AUXILIARY )
objectClasses: ( 1.3.6.1.4.1.35061.1.2.80.10
NAME 'virtuozzo'
DESC 'Virtuozzo container'
SUP VirtualMachine
AUXILIARY )
objectClasses: ( 1.3.6.1.4.1.35061.1.2.80.11
NAME 'openvz'
DESC 'OpenVZ container'
SUP VirtualMachine
AUXILIARY )
objectClasses: ( 1.3.6.1.4.1.35061.1.2.4
Expand Down Expand Up @@ -865,7 +886,7 @@ objectClasses: ( 1.3.6.1.4.1.35061.1.2.20
STRUCTURAL
MUST ( networkInterface )
MAY ( status $ speed $ ipHostNumber $ networkInterfaceMacAddress $
networkInterfaceGateway $ ipNetworkNumber $ networkInterfaceDhcpServer $
networkInterfaceGateway $ ipNetworkNumber $ networkSubnet $ networkInterfaceDhcpServer $
networkInterfaceMask $ networkInterfaceType $ networkInterfaceTypeMib) )
objectClasses: ( 1.3.6.1.4.1.35061.1.2.21
NAME 'software'
Expand Down

0 comments on commit 3475bc7

Please sign in to comment.