Disable unique constraints

Change-Id: I894f7654b776bb430664b2cfd600696ab0fcb1dc
This commit is contained in:
aviau 2015-07-23 11:35:48 -04:00
parent a09e815888
commit 2e3a5d6a6b
14 changed files with 26 additions and 17 deletions

View File

@ -17,6 +17,6 @@ import mongoengine
class BusinessImpactModulation(mongoengine.Document):
meta = {'collection': 'businessimpactmodulations'}
business_impact_modulation_name = mongoengine.StringField(unique=True)
business_impact_modulation_name = mongoengine.StringField()
business_impact = mongoengine.IntField()
modulation_period = mongoengine.StringField()

View File

@ -17,6 +17,6 @@ import mongoengine
class CheckModulation(mongoengine.Document):
meta = {'collection': 'checkmodulations'}
checkmodulation_name = mongoengine.StringField(unique=True)
checkmodulation_name = mongoengine.StringField()
check_command = mongoengine.StringField()
check_period = mongoengine.StringField()

View File

@ -16,7 +16,10 @@ import mongoengine
class Command(mongoengine.Document):
meta = {'collection': 'commands'}
command_name = mongoengine.StringField(unique=True)
meta = {
'collection': 'commands',
'strict': False
}
command_name = mongoengine.StringField()
command_line = mongoengine.StringField()
module_type = mongoengine.StringField()

View File

@ -17,7 +17,7 @@ import mongoengine
class Contact(mongoengine.Document):
meta = {'collection': 'contacts'}
contact_name = mongoengine.StringField(unique=True)
contact_name = mongoengine.StringField()
host_notifications_enabled = mongoengine.StringField()
service_notifications_enabled = mongoengine.StringField()
host_notification_period = mongoengine.StringField()

View File

@ -17,7 +17,7 @@ import mongoengine
class ContactGroup(mongoengine.Document):
meta = {'collection': 'contactgroups'}
contactgroup_name = mongoengine.StringField(unique=True)
contactgroup_name = mongoengine.StringField()
members = mongoengine.StringField()
alias = mongoengine.StringField()
contactgroup_members = mongoengine.StringField()

View File

@ -16,8 +16,11 @@ import mongoengine
class Host(mongoengine.Document):
meta = {'collection': 'hosts'}
host_name = mongoengine.StringField(unique=True)
meta = {
'collection': 'hosts',
'strict': False
}
host_name = mongoengine.StringField()
address = mongoengine.StringField()
max_check_attempts = mongoengine.IntField()
check_period = mongoengine.StringField()

View File

@ -17,7 +17,7 @@ import mongoengine
class HostGroup(mongoengine.Document):
meta = {'collection': 'hostgroups'}
hostgroup_name = mongoengine.StringField(unique=True)
hostgroup_name = mongoengine.StringField()
members = mongoengine.StringField()
alias = mongoengine.StringField()
hostgroup_members = mongoengine.StringField()

View File

@ -17,6 +17,6 @@ import mongoengine
class MacroModulation(mongoengine.Document):
meta = {'collection': 'macromodulations'}
macromodulation_name = mongoengine.StringField(unique=True)
macromodulation_name = mongoengine.StringField()
modulation_period = mongoengine.StringField()
macros = mongoengine.DictField()

View File

@ -17,7 +17,7 @@ import mongoengine
class NotificationWays(mongoengine.Document):
meta = {'collection': 'notificationways'}
notificationway_name = mongoengine.StringField(unique=True)
notificationway_name = mongoengine.StringField()
host_notification_period = mongoengine.StringField()
service_notification_period = mongoengine.StringField()
host_notification_options = mongoengine.StringField()

View File

@ -17,6 +17,6 @@ import mongoengine
class Realm(mongoengine.Document):
meta = {'collection': 'realms'}
realm_name = mongoengine.StringField(unique=True)
realm_name = mongoengine.StringField()
realm_members = mongoengine.StringField()
default = mongoengine.IntField()

View File

@ -16,8 +16,11 @@ import mongoengine
class Service(mongoengine.Document):
meta = {'collection': 'services'}
host_name = mongoengine.StringField(unique=True)
meta = {
'collection': 'services',
'strict': False
}
host_name = mongoengine.StringField()
service_description = mongoengine.StringField()
contacts = mongoengine.StringField()
check_command = mongoengine.StringField()

View File

@ -17,7 +17,7 @@ import mongoengine
class ServiceGroup(mongoengine.Document):
meta = {'collection': 'servicegroups'}
servicegroup_name = mongoengine.StringField(unique=True)
servicegroup_name = mongoengine.StringField()
members = mongoengine.StringField()
alias = mongoengine.StringField()
servicegroup_members = mongoengine.StringField()

View File

@ -17,6 +17,6 @@ import mongoengine
class TimePeriod(mongoengine.Document):
meta = {'collection': 'timeperiods'}
timeperiod_name = mongoengine.StringField(unique=True)
timeperiod_name = mongoengine.StringField()
exclude = mongoengine.StringField()
periods = mongoengine.DictField()

View File

@ -101,7 +101,7 @@ class TestMacroModulationController(functionalTest.FunctionalTest):
self.assertIsNotNone(
self.mongoconnection.shinken.macromodulations.find_one(
m
{'macromodulation_name': 'TEST_CREATE_MODULATION'}
)
)