FileNotFound Error while running python boto3

  amazon-eks, amazon-web-services, boto3, python, windows

This is a python file that will create vpc, subnets, EKS Cluster, Node Groups, NetApp Volume.
But for the sake of the subject of the question I have removed some of the script.

When I am running this file, this line is supposed to execute the managedcluster.sh shell script and generate cluster and node groups in the existing vpc.

subprocess.call(shlex.split(‘.managedcluster.sh’))

The shell script is not getting executed and the error says file not found.

import shlex
import subprocess
from Naked.toolshed.shell import execute_rb
import demo
import os
from pathlib import Path







############ Create EKS cluster ##################################################
clustercount=0
try:
 if clustercount == 0:
    success = execute_rb('read_config.rb')
    time.sleep(5)
    if success:
        print("managedcluster.yaml is generated")
        subprocess.call(shlex.split('.managedcluster.sh'))
        time.sleep(1800)
        print(" Cluster is created")
    else:
        sys.exit()
    clustercount += 1
except ClientError as e:
        logging.error(e)
print( "EKS Cluster created")

Error that I am getting:

FileNotFoundError: [WinError 2] The system cannot find the file specified

I have used os library as well as pathlib but no luck.
I am using windows os, hence what could be done to resolve this error ?

Source: Windows Questions

LEAVE A COMMENT