Quantcast
Channel: Active questions tagged config - Stack Overflow
Viewing all articles
Browse latest Browse all 5049

How to automate write in config file dynamically

$
0
0

Hi I have designed a function to create redshift cluster and getting its properties. How I can automate that function writeinconfig file trigger only when cluster status become available.

def prettyRedshiftProps(props):
    pd.set_option('display.max_colwidth', -1)
    keysToShow = ["ClusterIdentifier", "NodeType", "ClusterStatus", "MasterUsername", "DBName", 
   "Endpoint", "NumberOfNodes", 'VpcId']
    x = [(k, v) for k,v in props.items() if k in keysToShow]
    return pd.DataFrame(data=x, columns=["Key", "Value"])

myClusterProps = redshift.describe_clusters(ClusterIdentifier=DWH_CLUSTER_IDENTIFIER) 
['Clusters'][0]
prettyRedshiftProps(myClusterProps)

function for writing values of clusterprop in another config file.

# trigger the function when cluster status become available  
def writeinconfig :
    {
      ''' write values of clusterprops in config file'''
    }

Viewing all articles
Browse latest Browse all 5049

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>