title: Jenkins: invalid literal for int() with base 10: 'within' Build
body: <p>I have a python script that I tested on an EC2 instance, which works perfectly fine on the server but when I try to pass the same parameters from Jenkins job as shown below. I get the error message:</p>
  
  <blockquote>
    <blockquote>
      <p>Security Group Created <strong>sg-ca09bcae</strong> in vpc <strong>vpc-d79691b9</strong>. Traceback (most recent call last):   File "./create_sg.py", line 32, in 
          'FromPort': int(FROM_PORT_1.strip("")), 
      marked build as failure Finished: FAILURE> ValueError: invalid literal for int() with base 10: 'within' Build
      step 'Execute shell'</p>
    </blockquote>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/SQm5e.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SQm5e.png" alt="Jenkins Job Parameters"></a></p>
  
  <p>I'm pretty sure the error is because of the string parameter that I'm passing through Jenkins parameters but there isn't an option to send both From and To ports as integers in jenkins parameters. </p>
  
  <p>How can I set the parameters to an integer within Jenkins build job?</p>
  
  <p>Python code to create SG:</p>
  
  <pre><code>#!/usr/bin/env python
  
  import sys
  import boto3
  from botocore.exceptions import ClientError
  region = "us-west-1"
  
  VPC_ID=sys.argv[1]
  SECURITY_GROUP_NAME=sys.argv[2]
  DESCRIPTION=sys.argv[3]
  IP_PROTOCOL_1=sys.argv[4]
  FROM_PORT_1=sys.argv[5]
  TO_PORT_1=sys.argv[6]
  CIDR_IP_1=sys.argv[7]
  
  
  ec2 = boto3.client('ec2')
  
  response = ec2.describe_vpcs()
  
  vpc_id = VPC_ID
  
  try:
      response = ec2.create_security_group(GroupName=SECURITY_GROUP_NAME,Description=DESCRIPTION,VpcId=VPC_ID)
      security_group_id = response['GroupId']
      print('Security Group Created %s in vpc %s.' % (security_group_id, vpc_id))
  
      data = ec2.authorize_security_group_ingress(
          GroupId=security_group_id,
          IpPermissions=[
              {'IpProtocol': IP_PROTOCOL_1,
               'FromPort': int(FROM_PORT_1.strip("")),
               'ToPort': int(TO_PORT_1.strip("")),
               'IpRanges': [{'CidrIp': CIDR_IP_1}]}
          ]
      )
      print('Ingress Successfully Set %s' % data)
  except ClientError as e:
      print(e)
  </code></pre>