Exemplo n.º 1
0
):

    try:
        AdminTask.createWMQQueue(scope_id, [
            '-name',
            name,
            '-jndiName',
            jndi,
            '-queueName',
            mqname,
        ])
        print ''
        print('creating Queue ' + name, jndi)
    except:
        e = sys.exc_info()
        print e


for scope in scopes:
    scope_attributes = scope.attrib
    queues = scope.findall('.//queue')
    for q in queues:
        ime = q.find('name').text
        jndi = q.find('jndi').text
        mqname = q.find('queueName').text
        scope_type = fl.getScopeType(scope_attributes)
        scope_id = fl.getScopeId(scope_type, scope_attributes)
        createqueue(scope_id, ime, jndi, mqname)

AdminConfig.save()
Exemplo n.º 2
0
def createserver(node, server_name):
    AdminTask.createApplicationServer(node, ['-name', server_name])


def converttocluster(server_scope, cluster_name):
    AdminConfig.convertToCluster(server_scope, cluster_name)


def createclustermember(cluster, node, server_name):
    AdminConfig.createClusterMember(cluster, node,
                                    [['memberName', server_name]])


for scope in scopes:
    scope_attributes = scope.attrib
    cluster_scope_type = fl.getScopeType(scope_attributes)
    cluster_name = scope.attrib['Cluster']
    print cluster_name
    members = scope.findall('.//member')
    for member in members:
        member_attributes = member.attrib
        node_name = member.attrib['Node']
        server_name = member.attrib['Server']
        scope_type = fl.getScopeType(member_attributes)
        if AdminClusterManagement.checkIfClusterExists(cluster_name) \
            == 'false':
            createserver(node_name, server_name)
            server_id = fl.getScopeId(scope_type, member_attributes)
            converttocluster(server_id, cluster_name)
        elif AdminClusterManagement.checkIfClusterMemberExists(
                cluster_name, server_name) == 'false':