def _init_channels(self): #create a channel family. self.cf = misc_functions.create_channel_family() self.label = self.cf.get_label() #Create a new channel using the channel family info self.channel = misc_functions.create_channel(self.label, self.label, org_id=self.org_id) #Associate the channel family with the organization and set the maximum number of members it can have _insert_channel_family = """ INSERT INTO rhnPrivateChannelFamily( channel_family_id, org_id, max_members ) VALUES ( :channel_family_id, :org_id, :max_members )""" insert_channel_family = rhnSQL.prepare(_insert_channel_family) insert_channel_family.execute(channel_family_id=self.cf.get_id(), org_id=self.org_id, max_members=10) rhnSQL.commit() #Associate the channel with the server _insert_channel = "INSERT INTO rhnServerChannel( server_id, channel_id ) VALUES ( :server_id, :channel_id )" insert = rhnSQL.prepare(_insert_channel) insert.execute(server_id=self.testserver.getid(), channel_id=self.channel.get_id()) rhnSQL.commit()
def _init_channels( self ): #create a channel family. self.cf = misc_functions.create_channel_family() self.label = self.cf.get_label() #Create a new channel using the channel family info self.channel = misc_functions.create_channel( self.label, self.label, org_id = self.org_id ) #Associate the channel family with the organization and set the maximum number of members it can have _insert_channel_family = """ INSERT INTO rhnPrivateChannelFamily( channel_family_id, org_id, max_members ) VALUES ( :channel_family_id, :org_id, :max_members )""" insert_channel_family = rhnSQL.prepare( _insert_channel_family ) insert_channel_family.execute( channel_family_id = self.cf.get_id(), org_id = self.org_id, max_members = 10 ) rhnSQL.commit() #Associate the channel with the server _insert_channel = "INSERT INTO rhnServerChannel( server_id, channel_id ) VALUES ( :server_id, :channel_id )" insert = rhnSQL.prepare( _insert_channel ) insert.execute( server_id = self.testserver.getid(), channel_id = self.channel.get_id() ) rhnSQL.commit()