Skip to content

Autoscale client should base64-encode personality file contents #420

@jasondunsmore

Description

@jasondunsmore

Nova and Rackspace Autoscale both require personality file contents passed through the API to be base64-encoded. python-novaclient transparently base64-encodes the personality contents:
https://github.com/openstack/python-novaclient/blob/ecebc308b33/novaclient/v1_1/servers.py#L458

However, pyrax does not. When I create an Autoscale group with a personality file that has ASCII contents, the resulting file on the server is junk binary data.

au = pyrax.autoscale
sg = au.create(
    name="testasg",
    cooldown=30,
    min_entities=1,
    max_entities=1,
    launch_config_type="launch_server",
    server_name="testasgnode",
    flavor="2",
    image="042395fc-728c-4763-86f9-9b0cacb00701",
    disk_config="AUTO",
    personality=[{'path': "/tmp/testing", 'contents': "testtest"}],
)

However, if I create an Autoscale group with a personality file that has base64-encoded contents, the resulting file on the server contains the expected content.

au = pyrax.autoscale
sg = au.create(
    name="testasg",
    cooldown=30,
    min_entities=1,
    max_entities=1,
    launch_config_type="launch_server",
    server_name="testasgnode",
    flavor="2",
    image="042395fc-728c-4763-86f9-9b0cacb00701",
    disk_config="AUTO",
    personality=[{'path': "/tmp/testing", 'contents': "dGVzdHRlc3QK"}],
)

The Autoscale interface in pyrax should base64-encode the contents of each personality file before sending it to the Autoscale API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions