<commit_before>#!/bin/bash

# TODO(lpetrut): remove hardcoded stuff
MANILA_SERVICE_SECGROUP="manila-service"
NET_ID=$(neutron net-list | grep private | awk '{print $2}')

nova --os-username manila --os-tenant-name service --os-password <PASSWORD> \
     boot ws2012r2 --image=ws2012r2_kvm \
                   --flavor=100 \
                   --nic net-id=$NET_ID \
                   --user-data=/home/ubuntu/ssl/winrm_client_cert.pem \
                   --security-groups $MANILA_SERVICE_SECGROUP \
                   --poll
<commit_msg>Ensure manila service has available secgroup<commit_after>#!/bin/bash

# TODO(lpetrut): remove hardcoded stuff
MANILA_SERVICE_SECGROUP="manila-service"
NET_ID=$(neutron net-list | grep private | awk '{print $2}')

nova secgroup-delete $MANILA_SERVICE_SECGROUP
nova --os-username manila --os-tenant-name service --os-password <PASSWORD> \
   secgroup-create $MANILA_SERVICE_SECGROUP $MANILA_SERVICE_SECGROUP

echo "Adding security rules to the $MANILA_SERVICE_SECGROUP security group"
nova secgroup-add-rule $MANILA_SERVICE_SECGROUP tcp 1 65535 0.0.0.0/0
nova secgroup-add-rule $MANILA_SERVICE_SECGROUP udp 1 65535 0.0.0.0/0

nova --os-username manila --os-tenant-name service --os-password <PASSWORD> \
     boot ws2012r2 --image=ws2012r2_kvm \
                   --flavor=100 \
                   --nic net-id=$NET_ID \
                   --user-data=/home/ubuntu/ssl/winrm_client_cert.pem \
                   --security-groups $MANILA_SERVICE_SECGROUP \
                   --poll

{'fraction_non_alphanumeric': 0.11614173228346457, 'fraction_numerical': 0.03280839895013123, 'mean_word_length': 2.5057471264367814, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3732249', 'n_tokens_mistral': 556, 'n_tokens_neox': 512, 'n_words': 101}