예제 #1
0
def step_impl(context, userName, create_channel_config_update_name, consortium_name):
    directory = bootstrap_util.getDirectory(context)
    user = directory.getUser(userName)
    consortium_config_group = user.getTagValue(tagKey=consortium_name)

    peer_org_set = user.getTagValue(tagKey=context.table.rows[0]["PeerOrgSet"])
    peer_anchor_set_tag_key = context.table.rows[0]["[PeerAnchorSet]"]
    peer_anchor_config_group = None
    if peer_anchor_set_tag_key != "":
        peer_anchor_config_group = user.getTagValue(tagKey=peer_anchor_set_tag_key)

    channel_id = context.table.rows[0]["ChannelID"]
    # Loop through templates referenced orgs
    # mspOrgNames = [org.name for org in user.tags[templateName]]
    #TODO: Where does the system_channel_version come from?
    system_channel_version = 0
    channel_config_update = bootstrap_util.create_channel_config_update(system_channel_version, channel_id, consortium_config_group)

    # Add the anchors config group
    if peer_anchor_config_group:
        bootstrap_util.mergeConfigGroups(channel_config_update.write_set, peer_anchor_config_group)

    #Make sure orgs exist in consortium
    for orgName in peer_org_set:
        assert orgName in channel_config_update.write_set.groups['Application'].groups.keys(), "PeerOrgSet entry {0} not found in consortium".format(orgName)

    # Strip out any organizations that are NOT referenced in peerOrgSet
    for orgName in channel_config_update.write_set.groups['Application'].groups.keys():
        if not orgName in peer_org_set:
            del(channel_config_update.read_set.groups['Application'].groups[orgName])
            del(channel_config_update.write_set.groups['Application'].groups[orgName])

    user.setTagValue(create_channel_config_update_name, channel_config_update)
def step_impl(context, userName, create_channel_config_update_name, consortium_name):
    directory = bootstrap_util.getDirectory(context)
    user = directory.getUser(userName)
    consortium_config_group = user.getTagValue(tagKey=consortium_name)

    peer_org_set = user.getTagValue(tagKey=context.table.rows[0]["PeerOrgSet"])
    peer_anchor_set_tag_key = context.table.rows[0]["[PeerAnchorSet]"]
    peer_anchor_config_group = None
    if peer_anchor_set_tag_key != "":
        peer_anchor_config_group = user.getTagValue(tagKey=peer_anchor_set_tag_key)

    channel_id = context.table.rows[0]["ChannelID"]
    # Loop through templates referenced orgs
    # mspOrgNames = [org.name for org in user.tags[templateName]]
    # TODO: Where does the system_channel_version come from?
    system_channel_version = 0
    channel_config_update = bootstrap_util.create_channel_config_update(system_channel_version, channel_id,
                                                                        consortium_config_group)

    # Add the anchors config group
    if peer_anchor_config_group:
        bootstrap_util.merge_config_groups(channel_config_update.write_set, peer_anchor_config_group)

    # Make sure orgs exist in consortium
    for orgName in peer_org_set:
        assert orgName in channel_config_update.write_set.groups[
            'Application'].groups.keys(), "PeerOrgSet entry {0} not found in consortium".format(orgName)

    # Strip out any organizations that are NOT referenced in peerOrgSet
    for orgName in channel_config_update.write_set.groups['Application'].groups.keys():
        if not orgName in peer_org_set:
            del (channel_config_update.read_set.groups['Application'].groups[orgName])
            del (channel_config_update.write_set.groups['Application'].groups[orgName])

    user.setTagValue(create_channel_config_update_name, channel_config_update)
예제 #3
0
def step_impl(context, userName, create_channel_config_update_name, consortium_name):
    directory = bootstrap_util.getDirectory(context)
    user = directory.getUser(userName)
    consortium_config_group = user.getTagValue(tagKey=consortium_name)

    channel_id = context.table.rows[0]["ChannelID"]
    templateName = context.table.rows[0]["Template"]
    # Loop through templates referenced orgs
    # mspOrgNames = [org.name for org in user.tags[templateName]]
    #TODO: Where does the system_channel_version come from?
    system_channel_version = 0
    channel_config_update = bootstrap_util.create_channel_config_update(system_channel_version, channel_id, consortium_config_group)

    # Add the anchors signed config Items
    # anchorSignedConfigItemsName = context.table.rows[0]["Anchors"]
    # signedAnchorsConfigItems = user.tags[anchorSignedConfigItemsName]

    user.setTagValue(create_channel_config_update_name, channel_config_update)
예제 #4
0
def step_impl(context, userName, create_channel_config_update_name,
              consortium_name):
    directory = bootstrap_util.getDirectory(context)
    user = directory.getUser(userName)
    consortium_config_group = user.getTagValue(tagKey=consortium_name)

    channel_id = context.table.rows[0]["ChannelID"]
    templateName = context.table.rows[0]["Template"]
    # Loop through templates referenced orgs
    # mspOrgNames = [org.name for org in user.tags[templateName]]
    #TODO: Where does the system_channel_version come from?
    system_channel_version = 0
    channel_config_update = bootstrap_util.create_channel_config_update(
        system_channel_version, channel_id, consortium_config_group)

    # Add the anchors signed config Items
    # anchorSignedConfigItemsName = context.table.rows[0]["Anchors"]
    # signedAnchorsConfigItems = user.tags[anchorSignedConfigItemsName]

    user.setTagValue(create_channel_config_update_name, channel_config_update)