Search and replace

thierry thunot <[email protected]>
Newsgroups gmane.comp.sysutils.cfengine.general
Message-ID <[email protected]>
hello all,

I have another problem ;)
I tried to search lines and replace with values in a proxmox file, part of 
this file:

...

 success: function(response, opts) {
                    let res = response.result;
                    if (res === null || res === undefined || !res || res
                        .data.status.toLowerCase() !== 'active') {
                        Ext.Msg.show({
                            title: gettext('No valid subscription'),
                            icon: Ext.Msg.WARNING,
                            message: 
Proxmox.Utils.getNoSubKeyHtml(res.data.url),
                            buttons: Ext.Msg.OK,
                            callback: function(btn) {
                                if (btn !== 'ok') {
....

Note that Ext.Msg.show is repeated several times in the file but I only 
have to change this occurrence

i need to change it by :

 success: function(response, opts) {
                    let res = response.result;
                    if (res === null || res === undefined || !res || res
                        .data.status.toLowerCase() !== 'active') {
                        void{//Ext.Msg.show({
                            title: gettext('No valid subscription'),
                            icon: Ext.Msg.WARNING,
                            message: 
Proxmox.Utils.getNoSubKeyHtml(res.data.url),
                            buttons: Ext.Msg.OK,
                            callback: function(btn) {
                                if (btn !== 'ok') {


i try this bundle whitout success
bundle agent    sys_conf_proxmox
{
        methods:
        pve2::
        "any" usebundle => supp_message_subscription;

}
bundle agent    supp_message_subscription
{
        vars: 
        "msg_a_remplacer" string => "Ext.Msg.show({
                  title: gettext('No valid subscription'),";
        "msg_remplacant" string => "void({ //Ext.Msg.show({
                            title: gettext('No valid subscription'),";
        "fic_conf_pve" string => 
"/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js";
        files:
        "$(fic_conf_pve)"
        edit_line => 
remplacement_ligne($(msg_a_remplacer),$(msg_remplacant),all),
        edit_defaults => levee_limite_fic, 
        comment => "Supression subscription pve",
        classes => if_repaired(relance_web_pve),
        action => if_elapsed(60);

        services:
        "pveproxy.service"
                service_policy => "restart";


}
      body edit_defaults levee_limite_fic
     {
                  max_file_size => "500K";
                       }
bundle edit_line remplacement_ligne(a_remplacer,remplacant,nb_occurences)
{
        replace_patterns:
        "$(a_remplacer)"
        replace_with => ligne_text($(remplacant),$(nb_occurences));

        }

Thanks for your replies ;)

-- 
You received this message because you are subscribed to the Google Groups "help-cfengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/help-cfengine/48cc31f7-f218-44d0-a897-6c2155ba6d8fn%40googlegroups.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.