0

I am using config parser to read an item tasks or Tasks from an INI file. The problem with the code is, it is checking for the case of Item. but in my case the item can be having case. config file:

[tasks]
;Order of the tasks is important
Create_ElasticIP=yes
Create_VPC=yes
Create_InternetGateway=yes
Attach_InternetGateway=yes
Create_Subnet_Public=yes
Create_Subnet_Private=yes
Create_Subnet_Private1=yes
Common_Beanstalk_RDS=no
Create_NATGateway=yes
Create_SecurityGroup_Public=no
Create_SecurityGroup_Private=no
Create_ElasticBeanstalk=yes
UploadVersion_ElasticBeanstalk=no
Create_S3Bucket=no
Create_SQS=no
Create_DynamoDBTable=no
Create_RDS_DBInstance=yes

[Create_ElasticIP]
input=Create_ElasticIP.json
method=Create_ElasticIP

below is the code

config = configparser.ConfigParser()
config.optionxform = str
config.read(Ini_File)        
items=config.items('Tasks')

It is showing below error

raise NoSectionError(section) configparser.NoSectionError: No section: 'Tasks'

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
sunil
  • 17
  • 3

0 Answers0