<commit_before># How to Launch:
# Example: <validation-tests>/v2/tests/upgrade/upgrade_rancher_server.py
# -t 0.37.1 -s 172.16.58.3 -u aruneli
# base version has no significance now, but target version should be a
# valid rancher server version
# server option (-s): IP Address of the rancher server
# username is the username with which you ssh to your GCE instance

import argparse
from tests.validation_v2.cattlevalidationtest.core.common_fixtures import *  # NOQA
import requests
import time
import paramiko
import os


def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('-t', help='target version')
    parser.add_argument('-s', help='server node')
    parser.add_argument('-u', help='ssh username of rancher server host')
    args = parser.parse_args()
    logger.info(args)
    # current_rancher_server_version(args.s)
    upgrade(args.t, args.s, args.u)


def current_rancher_server_version(server, username):
    ssh = paramiko.SSHClient()
    ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
    privatekeyfile = os.path.expanduser('~/.ssh/google_compute_engine')
    mykey = paramiko.RSAKey.from_private_key_file(privatekeyfile)
    ssh.connect(server, username=username, pkey=mykey)
    cmd = "sudo docker ps -a | awk ' NR>1 {print $2}' | cut -d \: -f 2 | " \
          "cut -d \\v -f 2"
    stdin, stdout, stderr = ssh.exec_command(cmd)
    tag_of_rancher_server = stdout.readlines()[0].strip("\n")
    logger.info(tag_of_rancher_server)


def upgrade(target, servernode, username):

    logger.info("UPGRADING RANCHER SERVER TO TARGET")
<commit_msg>Fixed common fixtures path<commit_after># How to Launch:
# Example: <validation-tests>/v2/tests/upgrade/upgrade_rancher_server.py
# -t 0.37.1 -s 172.16.58.3 -u aruneli
# base version has no significance now, but target version should be a
# valid rancher server version
# server option (-s): IP Address of the rancher server
# username is the username with which you ssh to your GCE instance

import argparse
from common_fixtures import *  # NOQA
import requests
import time
import paramiko
import os
import sys


def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('-t', help='target version')
    parser.add_argument('-s', help='server node')
    parser.add_argument('-u', help='ssh username of rancher server host')
    args = parser.parse_args()
    logger.info(args)
    # current_rancher_server_version(args.s)
    upgrade(args.t, args.s, args.u)


def current_rancher_server_version(server, username):
    ssh = paramiko.SSHClient()
    ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
    privatekeyfile = os.path.expanduser('~/.ssh/google_compute_engine')
    mykey = paramiko.RSAKey.from_private_key_file(privatekeyfile)
    ssh.connect(server, username=username, pkey=mykey)
    cmd = "sudo docker ps -a | awk ' NR>1 {print $2}' | cut -d \: -f 2 | " \
          "cut -d \\v -f 2"
    stdin, stdout, stderr = ssh.exec_command(cmd)
    tag_of_rancher_server = stdout.readlines()[0].strip("\n")
    logger.info(tag_of_rancher_server)


def upgrade(target, servernode, username):

    logger.info("UPGRADING RANCHER SERVER TO TARGET")

{'fraction_non_alphanumeric': 0.11608832807570978, 'fraction_numerical': 0.01167192429022082, 'mean_word_length': 4.1477272727272725, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '3134738', 'n_tokens_mistral': 1100, 'n_tokens_neox': 1040, 'n_words': 273}