<commit_before>Param(
    [Parameter(Mandatory=$true)][string]$configDir,
    [Parameter(Mandatory=$true)][string]$templatePath,
    [Parameter(Mandatory=$true)][string]$serverIP,
    [Parameter(Mandatory=$true)][string]$rabbitUser,
    [Parameter(Mandatory=$true)][string]$logDir,
    [Parameter(Mandatory=$true)][string]$lockPath,
    [Parameter(Mandatory=$true)][string]$username,
    [Parameter(Mandatory=$true)][string]$password
)

function unzip($src, $dest) {

	$shell = new-object -com shell.application
	$zip = $shell.NameSpace($src)
	foreach($item in $zip.items())
	{
		$shell.Namespace($dest).copyhere($item)
	}

}
$serverIP =  (Get-NetIPAddress -AddressFamily IPv4 -PrefixOrigin Dhcp).IPAddress
$volumeDriver = 'cinder.volume.drivers.windows.smbfs.WindowsSmbfsDriver'
$smbSharesConfigPath = "$configDir\smbfs_shares_config.txt"
$configFile = "$configDir\cinder.conf"


$sharePath = "//$serverIP/SMBShare -o username=$username,password=$password"
sc $smbSharesConfigPath $sharePath

$template = gc $templatePath
$config = expand_template $template
Write-Host "Config file:"
Write-Host $config
sc $configFile $config

# FIX FOR qmeu-img - fetch locally compiled one
Invoke-WebRequest -Uri http://dl.openstack.tld/qemu-img-cbsl-build.zip -OutFile c:\qemu-img\qemu-img-cbsl-build.zip
if (! (Test-Path -Path c:\qemu2))
{
	mkdir c:\qemu2
}
else
{
	Remove-Item -Force -Recurse c:\qemu2
}
unzip c:\qemu-img\qemu-img-cbsl-build.zip c:\qemu2
Move-Item -Path C:\qemu2\* -Destination C:\qemu-img\ -Force

# Ensure Windows Share is available
if (! (Test-Path -Path C:\SMBShare))
{
    mkdir c:\SMBShare
}

if (!(Get-SMBShare -Name SMBShare))
{
    $hostname=hostname
    New-SMBShare -Name SMBShare -Path C:\SMBShare -FullAccess "$hostname\Admin"
}
Grant-SmbShareAccess -Name SMBShare -AccountName Admin -AccessRight Full -Force<commit_msg>Comment out ( else remove c:\qemu2 )<commit_after>Param(
    [Parameter(Mandatory=$true)][string]$configDir,
    [Parameter(Mandatory=$true)][string]$templatePath,
    [Parameter(Mandatory=$true)][string]$serverIP,
    [Parameter(Mandatory=$true)][string]$rabbitUser,
    [Parameter(Mandatory=$true)][string]$logDir,
    [Parameter(Mandatory=$true)][string]$lockPath,
    [Parameter(Mandatory=$true)][string]$username,
    [Parameter(Mandatory=$true)][string]$password
)

function unzip($src, $dest) {

	$shell = new-object -com shell.application
	$zip = $shell.NameSpace($src)
	foreach($item in $zip.items())
	{
		$shell.Namespace($dest).copyhere($item)
	}

}
$serverIP =  (Get-NetIPAddress -AddressFamily IPv4 -PrefixOrigin Dhcp).IPAddress
$volumeDriver = 'cinder.volume.drivers.windows.smbfs.WindowsSmbfsDriver'
$smbSharesConfigPath = "$configDir\smbfs_shares_config.txt"
$configFile = "$configDir\cinder.conf"


$sharePath = "//$serverIP/SMBShare -o username=$username,password=$password"
sc $smbSharesConfigPath $sharePath

$template = gc $templatePath
$config = expand_template $template
Write-Host "Config file:"
Write-Host $config
sc $configFile $config

# FIX FOR qmeu-img - fetch locally compiled one
Invoke-WebRequest -Uri http://dl.openstack.tld/qemu-img-cbsl-build.zip -OutFile c:\qemu-img\qemu-img-cbsl-build.zip
if (! (Test-Path -Path c:\qemu2))
{
	mkdir c:\qemu2
}
#else
#{
#	Remove-Item -Force -Recurse c:\qemu2
#}
unzip c:\qemu-img\qemu-img-cbsl-build.zip c:\qemu2
Move-Item -Path C:\qemu2\* -Destination C:\qemu-img\ -Force

# Ensure Windows Share is available
if (! (Test-Path -Path C:\SMBShare))
{
    mkdir c:\SMBShare
}

if (!(Get-SMBShare -Name SMBShare))
{
    $hostname=hostname
    New-SMBShare -Name SMBShare -Path C:\SMBShare -FullAccess "$hostname\Admin"
}
Grant-SmbShareAccess -Name SMBShare -AccountName Admin -AccessRight Full -Force
{'fraction_non_alphanumeric': 0.15762483130904184, 'fraction_numerical': 0.0035087719298245615, 'mean_word_length': 5.176666666666667, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '927245', 'n_tokens_mistral': 1350, 'n_tokens_neox': 1330, 'n_words': 240}